npm peerDependency issue with grunt and flatiron peer

别来无恙 提交于 2019-12-02 17:07:51

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.

If you don't mind keeping jitsu installed, you can just upgrade jitsu and this should work.

npm install -g jitsu
npm install -g grunt-cli
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!