npm won't run after update (Linux)
This just hapened to me, and I'm writing this for anyone who may need it.
After doing a global update on my CentOS machine with
npm update -g
I got this error:
/usr/local/bin/npm: No such file or directory
The symlink in /usr/local/bin was broken, but copying it from /usr/bin did not work, npm throwing this error:
Cannot find module '../lib/npm.js'
So, the solution was to:
- Remove everything from ~/.npm
- Re-install npm with
curl http://npmjs.org/install.sh | sh
- Re-build the hash database
hash -r
Written by Marius Stuparu
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Linux
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#