我正在发现Yeoman,并尝试安装 yeoman 的“入门”部分中显示的简单生成器。
我安装了 npm 然后 yo 和 bower 就像文档中解释的那样:
npm install -g yo bower
当我尝试安装 generator-webapp 和 generator-spring ( sudo npm install -g generator-webapp
) 时,我在这两种情况下都会得到这个输出:
[...]
npm http 304 https://registry.npmjs.org/amdefine
npm http 304 https://registry.npmjs.org/es6-iterator
npm http 304 https://registry.npmjs.org/es6-symbol
npm ERR! peerinvalid The package yo does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer generator-mocha@0.1.6 wants yo@>=1.0.0
npm ERR! peerinvalid Peer generator-spring@0.1.2 wants yo@>=1.0.0-rc.1
npm ERR! peerinvalid Peer generator-webapp@0.5.1 wants yo@>=1.2.0
npm ERR! System Linux 3.11.0-12-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "generator-webapp"
npm ERR! cwd /home/adenoyelle
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.2.18
npm ERR! code EPEERINVALID
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/adenoyelle/npm-debug.log
npm ERR! not ok code 0
因此,我查看了 yo 版本的:
~ [ sudo npm update -g yo
npm http GET https://registry.npmjs.org/yo
npm http 304 https://registry.npmjs.org/yo
~ [ yo -version
1.1.2
所以,我有几个问题:
- 为什么Yo的版本卡在1.1.2(好像有1.3.3的版本存在)
- 当我询问 generator-spring 时,为什么 Yo 还尝试获取 generator-webapp?generator-spring 只需要 Yo 1..0.0-rc.1 所以它应该可以工作。