Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

env: node: No such file or directory in mac

I'm searching it in google on how to show the version of node js or how I'm gonna work with npm? If I do this

npm -v 

even I already install it using brew install node. The result is always

env: node: No such file or directory 

I already do a lot of command to solve for it, but failed. these are the command that I already try:

sudo apt-get install nodejs-legacy sudo ln -s /usr/local/bin/node /usr/bin/node brew unlink node brew link node 

I can't start the task because of this. help me guys. This work before after I used this command brew link --overwrite node. Now I have problem, i cant work anymore with npm. I'm really new about this. I don't have any idea now on how to fix this.

Update

I already get the list using npm list command. I also get the idea here link but when I npm install inside the project. I alwayst get this "result env: node: No such file or directory",even I command npm -v but If i command it outside my project. It work the npm -v

like image 548
user3818576 Avatar asked Apr 18 '17 06:04

user3818576


1 Answers

I solved it this way:

$ brew uninstall --force node $ brew uninstall --force npm 

after it

$ brew install node 

which suggested me to overwrite simlinks

Error: The `brew link` step did not complete successfully The formula built, but is not symlinked into /usr/local Could not symlink share/doc/node/gdbinit Target /usr/local/share/doc/node/gdbinit already exists. You may want to remove it:   rm '/usr/local/share/doc/node/gdbinit'  To force the link and overwrite all conflicting files:   brew link --overwrite node 

after executing

$ brew link --overwrite node 

everything worked again.

like image 64
jozh Avatar answered Oct 11 '22 12:10

jozh