I made a horrible mistake and run this command:
sudo npm update -g npm
As a result npm was rendered useless, any attemps to install anything results in the following error :
npm ERR! Darwin 15.0.0
npm ERR! argv "/Users/michaelb/.nvm/versions/node/v5.3.0/bin/node" "/Users/michaelb/.nvm/versions/node/v5.3.0/bin/npm" "install"
npm ERR! node v5.3.0
npm ERR! npm v3.7.4
npm ERR! code MODULE_NOT_FOUND
npm ERR! Cannot find module 'read-package-json'
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
Can anyone speculate what is the problem and how to fix it ?
Im using OS X El Capitan (10.11)
node -v
v5.3.0
npm -v
3.7.4
nvm ls
-> v5.3.0
default -> stable (-> v5.3.0)
node -> stable (-> v5.3.0) (default)
stable -> 5.3 (-> v5.3.0) (default)
iojs -> N/A (default)