I am trying to get npm to work. In the process, I seem to have two versions of it installed: A corrupt one installed in ~/bin, and another I just compiled and ran make install to put it in /usr/local/bin/npm.So, I moved the entire ~/bin folder into ~/old/bin ... but still when I run npm the system searches in ~/bin:$ which npm/usr/local/bin/npm$ alias npm-bash: alias: npm: not found$ npm-bash: /home/ubuntu/bin/npm: No such file or directory$ echo $PATH/home/ubuntu/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games$What causes Ubuntu to look for npm in ~/bin/npm ? I'm using Ubuntu 11.10. I don't know if the question is ubuntu-specific or not, it can be moved to askubuntu if needed.I do see ~/bin in the PATH, but as far I as understand this only means that if npm was present at ~/bin then it would have used it ... but why does bash insist to look for it specifically there? Why doesn't it find /usr/local/bin/npm, even though the which command does find it?
What determines the path where the system searches for a file?
bash;executable
The executable's previously known location is likely hashed by the shell. Resetting the shell's cache with hash -r should fix the issue.If you don't want to reset the entire cache, you can delete the individual entry for npm using hash -d npm.