如何解决此问题,以便安装Polymer Starter Kit?
命令:
$ yo polymer
引发以下错误:
readline.js:924
throw err;
^
Error: Cannot find module 'yeoman-environment'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:289:25)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at Object.<anonymous> (/usr/local/lib/node_modules/generator-polymer/node_modules/yeoman-generator/index.js:7:19)
at Module._compile (module.js:425:26)
at Object.Module._extensions..js (module.js:432:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:313:12)
at Module.require (module.js:366:17)
at require (module.js:385:17)
工具链:
$ node -v
v5.1.1
$ npm -v
3.5.1
$ yo --version
1.5.0
$ bower --version
1.6.9
$ grunt --version
grunt-cli v0.1.13
$ gulp --version
CLI version 3.9.0
答案 0 :(得分:0)
全局安装Yeoman Polymer-generator。
$ cd
$ sudo npm install --global generator-polymer
# or
$ sudo npm install -g generator-polymer
然后在项目目录中安装Yeoman Polymer-generator。
$ cd path/to/project
$ sudo npm install --global generator-polymer
# or
$ sudo npm install -g generator-polymer