What determines the path where the system searches for a file?

view full story

http://unix.stackexchange.com – 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 ~/ (HowTos)