Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot run npm install browserify

I try to run npm install browserify both locally and globally (-g)

but I always got the follow errors

npm ERR! peerinvalid The package bn.js does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer [email protected] wants bn.js@^0.16.0

npm ERR! System Darwin 14.0.0
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "browserify"
npm ERR! cwd /Users/kanitw/Dropbox/_Projects/_idl/_visrec/vegalite
npm ERR! node -v v0.10.24
npm ERR! npm -v 1.3.21
npm ERR! code EPEERINVALID
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/kanitw/Dropbox/_Projects/_idl/_visrec/vegalite/npm-debug.log
npm ERR! not ok code 0

Not sure how to solve it.

(My node version is v0.10.24, I'm on OSX Yosemite)

like image 365
kanitw Avatar asked Jan 02 '15 13:01

kanitw


2 Answers

In order to make the workaround work, you have to

  1. Delete the existing node_modules folder.
  2. npm install [email protected] --save-peer
  3. npm install browserify

That works guaranteed.

like image 61
Houman Avatar answered Sep 30 '22 06:09

Houman


Had the same issue on Linux. Try running npm update -g before installing browserify. This has worked for me.

like image 26
kharhys Avatar answered Sep 30 '22 05:09

kharhys