npm peer与grunt和flatiron peer的依赖问题 [英] npm peerDependency issue with grunt and flatiron peer
问题描述
当我运行时:
sudo npm install - g grunt
最后一部分说:
/ usr / bin / grunt - > / usr / lib / node_modules / grunt / bin / grunt
npm ERR! peerinvalid包flatiron不满足其兄弟的peerDependencies要求!
npm ERR! peerinvalid Peer flatiron-cli-config@0.1.3需要flatiron@~0.1.9
npm ERR! peerinvalid Peer flatiron-cli-users@0.1.1需要flatiron@~0.1.9
npm ERR!系统Linux 3.5.0-23-generic
npm ERR!命令nodejs/ usr / bin / npminstall-ggrunt
npm ERR! cwd / home / explunit
npm ERR! node -v v0.8.19
npm ERR! npm -v 1.2.9
npm ERR!代码EPEERINVALID
npm ERR!
npm ERR!附加的日志记录细节可以在以下位置找到:
npm ERR! /home/explunit/npm-debug.log
npm ERR!不好的代码0
正如你在上面看到的,我在节点0.8.19和npm 1.2.9(来自ppa的最新消息:Ubuntu 12.10上的chris-lea)。
我尝试过的其他事情:
- 在新安装的Ubuntu上做了同样的事情。没有错误。脚本输出看起来是相同的,直到最后几个错误行为止。
- 运行sudo npm cache clean,然后重试。
npm list -g方案
当我这样做时,我看到了全局安装的模块列表(例如bower,jshint,mocha) ,并在最后:
npm ERR! peer无效:flatiron@0.3.0 / usr / lib / node_modules / jitsu / node_modules / flatiron
npm ERR!不好的代码0
然后我运行这个命令查看哪些是使用flatiron的:
npm list -g flatiron
在这种情况下,它是jitsu,我不再使用的模块。我跑了
sudo npm uninstall -g jitsu
sudo npm uninstall -g grunt
然后再次运行原始命令。 请注意,稍后会有人提出这个问题:在发布0.4 现在 grunt-cli
,而不是 grunt
就像我问原始问题一样。
如果我真的想保留jitsu,我可以更新它而不是卸载它(谢谢@BenAtkin):
npm install -g jitsu
然后再次运行原始命令。请参阅有关peerDependency被添加到节点0.8.19中的此博客文章更多背景。
While posting this question I figured out the answer, but I'll post both here in case it helps someone else, and perhaps someone can help with the why of what happened.
When I run:
sudo npm install -g grunt
the last part of it says:
/usr/bin/grunt -> /usr/lib/node_modules/grunt/bin/grunt
npm ERR! peerinvalid The package flatiron does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer flatiron-cli-config@0.1.3 wants flatiron@~0.1.9
npm ERR! peerinvalid Peer flatiron-cli-users@0.1.1 wants flatiron@~0.1.9
npm ERR! System Linux 3.5.0-23-generic
npm ERR! command "nodejs" "/usr/bin/npm" "install" "-g" "grunt"
npm ERR! cwd /home/explunit
npm ERR! node -v v0.8.19
npm ERR! npm -v 1.2.9
npm ERR! code EPEERINVALID
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/explunit/npm-debug.log
npm ERR! not ok code 0
As you can see in the above, I am on node 0.8.19 and npm 1.2.9 (the latest that comes down from ppa:chris-lea on Ubuntu 12.10).
Other things I tried:
- Did the same on a fresh Ubuntu install. No errors. The script output looks the same until those last few error lines.
- Ran "sudo npm cache clean" and tried again. No luck.
- Ran "npm list" and there was nothing else listed
My mistake was not appending the -g on the npm list command.
npm list -g
Once I did that, I saw my list of globally installed modules (e.g. bower, jshint, mocha), and at the very end:
npm ERR! peer invalid: flatiron@0.3.0 /usr/lib/node_modules/jitsu/node_modules/flatiron
npm ERR! not ok code 0
Then I ran this command to see which ones were using flatiron:
npm list -g flatiron
In this case it was jitsu, a module I'm not using anymore. I ran
sudo npm uninstall -g jitsu
sudo npm uninstall -g grunt
And then ran the original command again. Note for anyone coming later to this question: The correct module for reinstalling grunt command-line globally after the release of 0.4 is now grunt-cli
, NOT grunt
like when I asked the original question.
If I actually wanted to keep jitsu I could have updated it instead of uninstalling it (thanks @BenAtkin):
npm install -g jitsu
And then run the original command again. See this blog post about peerDependency being added in node 0.8.19 for more background.
这篇关于npm peer与grunt和flatiron peer的依赖问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!