Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

installed nodejs from source, now errors

Tags:

node.js

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.

like image 233
ryan Avatar asked Oct 16 '11 00:10

ryan


People also ask

How do you check if you have Nodejs installed?

To see if Node is installed, open the Windows Command Prompt, Powershell or a similar command line tool, and type node -v . This should print a version number, so you'll see something like this v0.

Do I need to restart my PC after installing Nodejs?

You will need to modify your code to make use of the new module... so yes, you have to restart that particular node process.

What is Enoent error in Nodejs?

The “enoent” can appear because of some missing files or usage of the relative path that can be solved by creating an expected directory structure or using an absolute path, respectively. There are also many other reasons for getting this error.


1 Answers

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.)

like image 195
sarnold Avatar answered Sep 22 '22 16:09

sarnold