Inconsistent behavior when installing NPM packages worldwide

I am trying to install NPM packages on Ubuntu (12.04). I installed Node.js and NPM through the Chris Lea PPA repository .

I'm trying to deploy

+6
source share
3 answers

You need to install it only with npm install -d , without -g . Package requirements are local to each package (so you have node_modules\a when you depend on a and node_modules\a\node_modules\b when a depends on b ).

See http://npmjs.org/doc/faq.html#I-installed-something-globally-but-I-can-t-require-it for details.

+5
source

flushing the cache worked for me

 npm cache clean 
+2
source

For me, this is solved with the following command -

npm install -d kanso@0.3.4 --registry http://registry.npmjs.org/

-2
source

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


All Articles