npm peerDependency issue with grunt and flatiron peer
Asked Answered
P

2

28

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 [email protected] wants flatiron@~0.1.9
npm ERR! peerinvalid Peer [email protected] 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
Preschool answered 14/2, 2013 at 22:17 Comment(0)
P
57

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: [email protected] /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.

Preschool answered 14/2, 2013 at 22:17 Comment(1)
Thanks for the question and the answer, was going nuts trying to install browserify, with the same error and the same module (jitsu) messing it up. It really wasn't clear to me that the problem was with my environment, I was convinced that the problem was with browserify, nearly raised an issue, embarrassment averted thanks :)Culinary
J
9

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
Julijulia answered 20/2, 2013 at 6:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.