Cannot start npm install browserify

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

but I always got the following errors

 npm ERR! peerinvalid The package bn.js does not satisfy its siblings' peerDependencies requirements! npm ERR! peerinvalid Peer miller-rabin@1.1.2 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 

I don’t know how to solve it.

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

+5
source share
5 answers

To make a workaround work, you must

  • Delete the existing node_modules folder.
  • npm install miller-rabin@1.1.1 --save-peer
  • npm install browserify

This is guaranteed.

+3
source

This commit introduced a violation: https://github.com/indutny/miller-rabin/commit/bb85f555974587a410a17173f0bc484133b53cb7

The author of the library should fix it, but meanwhile you can:

  • Delete existing node_modules folder
  • npm install miller-rabin@1.1.1 --save-peer
  • npm install browserify
+2
source

Had the same problem on Linux. Try running npm update -g before installing the browser. It worked for me.

+2
source

Recently found this problem in github browser.

https://github.com/substack/node-browserify/issues/1049

There is a workaround.

+1
source

Details on the workaround for issues on the github page

Error list

To summarize the solution posted in the problem, you need to install miller-rabin@1.1.1 as a peer-to-peer dependency in your own project (npm install miller-rabin@1.1.1 --save-peer), which makes sure that bn.js@0.15 , and not more late version.

Hope this helps!

0
source

Source: https://habr.com/ru/post/1210255/


All Articles