19

Whenever I am installing any global package I am getting this error.

Error:- on npm packages global install

For example:-

robins@robins-H61MLV3:~$ sudo npm install -g jshint

/usr/bin/jshint -> /usr/lib/node_modules/jshint/bin/jshint
npm ERR! Linux 3.19.0-25-generic
npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "jshint"
npm ERR! node v0.10.25
npm ERR! npm  v2.13.2
npm ERR! code EPEERINVALID

npm ERR! peerinvalid The package [email protected] does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer [email protected] wants karma@~0.10.0
npm ERR! peerinvalid Peer [email protected] wants karma@>=0.9
npm ERR! peerinvalid Peer [email protected] wants karma@>=0.12.8
npm ERR! peerinvalid Peer [email protected] wants karma@>=0.9
npm ERR! peerinvalid Peer [email protected] wants karma@>=0.9
npm ERR! peerinvalid Peer [email protected] wants karma@>=0.9
npm ERR! peerinvalid Peer [email protected] wants karma@>=0.9
npm ERR! peerinvalid Peer [email protected] wants karma@>=0.9

What I have tried so far

I have tried updating the global karma and its related modules but it didn't worked. I have also tried uninstalling karma modules but the problem persists.

sudo npm uninstall -g  karma grunt-karma karma-html2js-preprocessor  karma-mocha karma-phantomjs-launcher karma-script-launcher  karma-jasmine  karma-requirejs karma-coffee-preprocessor
1
  • >>npm ERR! peerinvalid Peer [email protected] wants karma@>=0.12.8 Is the version of Karma >=0.12.8 in your Package.json ?
    – Sèb
    Commented Mar 14, 2017 at 15:08

4 Answers 4

26

It looks like karma has some dependencies on other modules that are available (global), but are older. You'd need to update your global packages using npm update -g

npm update -g

Basically "npm update -g" just updates all Global packages. "All" because no package name has been provided and "global" because of the "-g" switch.

My suggestion is to first update all of your global packages and then try installing jshint again.

sudo npm install -g jshint
1
  • 2
    tried updating the npm still showing the same error while updating npm too. Commented Nov 20, 2015 at 10:09
10

update npm by using command

npm install npm -g

then clean the cache using

npm cache clean

then install the package as per your requirement. Hope, this would help all.

0
0

I fixed the problem by just naming my project with a single word instead of a phrase that I had used before.

1
0

It's not a fix for NPM, but a workaround in my case (using Ubuntu 16.04) on this issue was to install yarn and run "yarn install" instead of "npm install".

Not the answer you're looking for? Browse other questions tagged or ask your own question.