简体   繁体   中英

installed nodejs from source, now errors

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.

  1. Installed node from ubuntu repo
  2. Installed node from source
  3. Uninstalled node from source ( sudo make uninstall , succeeds)
  4. 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 the PATH environment variable. (It doesn't want to repeat this search every single time you type ls or cat , 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 -r to remove all the mappings from the built-in table. (Well, you can remove an individual entries using hash -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.)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM