I’m on ubuntu. Installed node from ubuntu repository and everything was fine. Needed node-waf for one of the modules I was trying to install so I installed node to latest unstable from source. Now npm is broken. Want to go back to node 0.4 stable but when I uninstall the from source version i’m having problems.
- Installed node from ubuntu repo
- Installed node from source
- Uninstalled node from source (
sudo make uninstall, succeeds) - Runnning node results in:
bash: /usr/local/bin/node: No such file or directory
How can I get it to stop looking for node in that path? Ubuntu repo node binaries still exist in /usr/bin/node. Running
cd /usr/bin ; ./node -v
works and spits out v0.4.12.
Running
cd /usr/bin ; node
errors.
The
bash(1)shell will store the full pathname of an executable the first time it must search through the directories in thePATHenvironment variable. (It doesn’t want to repeat this search every single time you typelsorcat, that’d be significantly slower than just looking up the exact pathname in a table.)This process normally works without incident — until you (re)move an executable between directories in the
PATH.New shells will not have trouble. Existing shells will need you to run
hash -rto remove all the mappings from the built-in table. (Well, you can remove an individual entries usinghash -d node, but re-populating the cache isn’t horrible — you do it every single time you start a shell — and if there are multiple programs that are now missing, removing them all will save you from removing them individually.)