我正在尝试按照 https://www.npmjs.com/package/generator-mean-seed 上给出的说明进行操作
当我尝试运行“sudo npm install -g Generator-mean-seed”时,出现此错误
npm install -g generator-mean-seed
npm WARN deprecated lodash@1.3.1: lodash@<2.0.0 is no longer maintained. Upgrade to lodash@^3.0.0
npm WARN deprecated CSSselect@0.7.0: the module is now available as 'css-select'
npm WARN deprecated CSSwhat@0.4.7: the module is now available as 'css-what'
npm WARN deprecated lodash@1.2.1: lodash@<2.0.0 is no longer maintained. Upgrade to lodash@^3.0.0
/usr/local/lib
├── generator-mean-seed@1.1.26
└── UNMET PEER DEPENDENCY yo@>=1.0.0
npm WARN generator-mean-seed@1.1.26 requires a peer of yo@>=1.0.0 but none was installed.
它说我需要安装 > 1.0.0 版本,但我已经安装了
yo --version
1.6.0
知道我做错了什么或者有任何解决这个问题的线索吗?
最佳答案
我遇到了同样的问题...原因似乎是在更高版本的 npm 中对等依赖项的安装发生了变化。作为解决方法,请在安装 generator-mean-seed
时包含 yo
(无论是否已安装):
$ sudo npm install -g yo generator-mean-seed
这样,generator-mean-seed 将正确安装:
$ sudo npm install -g yo generator-mean-seed
npm WARN deprecated lodash@1.3.1: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^4.0.0.
npm WARN deprecated CSSselect@0.7.0: the module is now available as 'css-select'
npm WARN deprecated CSSwhat@0.4.7: the module is now available as 'css-what'
npm WARN deprecated lodash@1.2.1: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^4.0.0.
npm WARN deprecated graceful-fs@3.0.8: graceful-fs version 3 and before will fail on newer node releases. Please update to graceful-fs@^4.0.0 as soon as possible.
npm WARN deprecated npmconf@2.1.2: this package has been reintegrated into npm and is now out of date with respect to npm
/usr/local/bin/yo -> /usr/local/lib/node_modules/yo/lib/cli.js
> yo@1.7.0 postinstall /usr/local/lib/node_modules/yo
> yodoctor
关于node.js - 安装生成器平均种子时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34714085/