I’ve been using node .4x and npm, and decided to upgrade to .67. Oh boy.
I’m on Mac OSX–new to it.
When I type npm I get
-bash: /usr/bin/npm: No such file or directory
echo $PATH shows a lot of stuff…some redundancies.
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/git/bin:/Users/me/.rvm/bin:/usr/local/bin:/usr/local/:/usr/local/bin:/usr/local/bin/npm:/usr/local/bin/:/usr/local:/usr/local/bin:/usr/local/
I’ve tried a number of different installations, and likely should clean it up, which I don’t know how to do 🙂
Any insights?
If
npmis no longer installed in/usr/bin/npm, then chances are goodbash(1)has hashed the executable name. The hashing saves repeated searches of all directories in yourPATHevery time you execute common programs. Since programs almost never change directories, this is usually a great idea.To test, run
hash -r. This will causebash(1)to forget all its mappings. (This is harmless — it starts up with no mappings and grows them over time.) If I was right, yournpmwill execute the correct executable wherever it lives.