NPM error for any team

I downloaded the latest version of Node.js (0.8.8) and everything works fine and dandy, but NPM packed with Node.js installation now fails. It worked when I had an outdated version of Node.js (0.5.x), and I could type commands like

npm --version 

and it will return the current version of NPM. However, when I execute any command (even higher), I get this error

 $ npm -v /usr/lib/node_modules/npm/lib/utils/config-defs.js:5 , stdio = process.binding("stdio") ^ Error: No such module at Object.<anonymous> (/usr/lib/node_modules/npm/lib/utils/config-defs.js:5:21) at Module._compile (module.js:449:26) at Object.Module._extensions..js (module.js:467:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:362:17) at require (module.js:378:17) at Object.<anonymous> (/usr/lib/node_modules/npm/lib/utils/ini.js:43:18) at Module._compile (module.js:449:26) at Object.Module._extensions..js (module.js:467:10) 

I am using NPM version 1.1.59

Note. I tried updating NPM with

 $ curl -L curl http://npmjs.org/install.sh | sudo sh 

But that didn't work either.

+6
source share
1 answer

Thanks Sean commented on the answer to his post , I get it. After I removed the npm module from

 /usr/lib/node_modules/ 

and binary code from

 /usr/bin/ 

Now everything works.

I think that after installing the latest version of Node.js, it could be conflicting, since both paths were global. Hope this helps anyone in the future :-)

+14
source

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


All Articles