Reputation: 21
This is the error i got when try to install npm. please help me to fix it.
module.js:549
throw err;
^
Error: Cannot find module 'semver'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (C:\Users\maheshig\AppData\Roaming\npm\node_modules\npm\lib\utils\unsupported.js:2:14)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
Upvotes: 0
Views: 15105
Reputation: 11
I solved it using a version manager, nvm. It seemed to be some incompatibility between the node version and the npm version I was trying to install.
Upvotes: 0
Reputation: 306
In linux you can use the following
sudo rm -rf /usr/lib/node_modules/
or wherever your global node_modules are
then reinstall npm
this solved the problem with me.
Upvotes: 2
Reputation: 21
I followed These steps and it solved my issue
Upvotes: 2