Skip to content
This repository has been archived by the owner. It is now read-only.

run npm command gives error "/usr/bin/env: node: No such file or directory" #3911

Closed
nickgit opened this issue Aug 23, 2012 · 117 comments
Closed

run npm command gives error "/usr/bin/env: node: No such file or directory" #3911

nickgit opened this issue Aug 23, 2012 · 117 comments

Comments

@nickgit
Copy link

@nickgit nickgit commented Aug 23, 2012

This happens in version 0.6.x on ubuntu. Does not happen above 0.7.x

@bnoordhuis
Copy link
Member

@bnoordhuis bnoordhuis commented Aug 23, 2012

Not a node bug. The node binary is not on your $PATH.

Loading

@bnoordhuis bnoordhuis closed this Aug 23, 2012
@digitalmediums
Copy link

@digitalmediums digitalmediums commented Sep 27, 2012

I've found this is often a misnaming error, if you install from a package manager you bin may be called nodejs so you just need to symlink it like so "ln -s /usr/bin/nodejs /usr/bin/node"

Loading

@mtrovo
Copy link

@mtrovo mtrovo commented Jan 17, 2013

digitalmediums,
That was useful, thanks a lot!

Loading

@houmie
Copy link

@houmie houmie commented Jan 28, 2013

After 3 hours of suffering, this is the solution. Thank you digitalmediums. Why is this now misnaming happening now out of the blue?

Loading

@othiym23
Copy link

@othiym23 othiym23 commented Jan 28, 2013

@houmie (and everyone who comes across this bug in the future)

These explain why:

http://lists.debian.org/debian-devel-announce/2012/07/msg00002.html
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=614907
http://debian.2.n7.nabble.com/Node-js-and-it-s-future-in-debian-td1042211.html (only read this last thread if you're a masochist)

As a Node developer, I would think hard before using Debian's packaged version of node, and would use Ubuntu with chrislea's PPA for Node or Debian stable with Node built from source in preference to the stock Debian nodejs package for the foreseeable future. The discussion on this bug makes clear that Debian has a very different idea of the role of Node in the wider world than most of the Node community.

Loading

@houmie
Copy link

@houmie houmie commented Jan 29, 2013

@othiym23 Thank you for the explanation. :) I see there is a proper flame war around this. But its understandable when namespaces are broken. Hope they can resolve it at one stage.

Loading

@micfan
Copy link

@micfan micfan commented Mar 5, 2013

Loading

@Augustin82
Copy link

@Augustin82 Augustin82 commented Mar 6, 2013

Thanks for the help.

Loading

@JohnArcher
Copy link

@JohnArcher JohnArcher commented Mar 15, 2013

@digitalmediums Thanks!

Loading

@johnjbarton
Copy link

@johnjbarton johnjbarton commented Apr 12, 2013

I installed via sudo make install.

npm still fails:

/work/qpp$ sudo npm install -g grunt-cli
/usr/bin/env: node: No such file or directory
/work/qpp$ node -v
v0.10.4
/work/qpp$ which node
/usr/local/bin/node

Loading

@bnoordhuis
Copy link
Member

@bnoordhuis bnoordhuis commented Apr 12, 2013

@johnjbarton Try sudo PATH="$PATH:/usr/local/bin" npm install -g grunt-cli

Loading

@johnjbarton
Copy link

@johnjbarton johnjbarton commented Apr 12, 2013

Thanks. However in the meantime I uninstalled node, unintalled npm, then
installed node and installed npm. Then I was able to install grunt-cli.

On Fri, Apr 12, 2013 at 2:13 PM, Ben Noordhuis notifications@github.comwrote:

@johnjbarton https://github.com/johnjbarton Try sudo
PATH="$PATH:/usr/local/bin" npm install -g grunt-cli


Reply to this email directly or view it on GitHubhttps://github.com//issues/3911#issuecomment-16317844
.

Loading

@arky
Copy link

@arky arky commented Jun 5, 2013

Just do

$ sudo apt-get install nodejs-legacy

https://github.com/volojs/volo#install

Loading

@gw0
Copy link

@gw0 gw0 commented Jun 8, 2013

Yes, installing nodejs-legacy is the cleanest solution.

Imho trying to name a server with a generic word like node is pretty stupid and it is quite understandable that there is so much resistance in accepting such a name. Rename it back to something unique that is easy to google for and can not be mistaken for something else, like nodejs, and everyone will be happy.

Loading

@bnoordhuis
Copy link
Member

@bnoordhuis bnoordhuis commented Jun 8, 2013

For very restricted definitions of 'everyone'. You're only two or three years late - that ship has long sailed.

Loading

@ForbesLindesay
Copy link

@ForbesLindesay ForbesLindesay commented Jun 8, 2013

That ship sailed a long time ago and those arguments only really apply to something that's not vastly popular. node.js is popular enough to claim the node name and expect other less popular programs not to conflict with it.

As for not being googlable: https://www.google.com/?q=node

Loading

@amitmnnit
Copy link

@amitmnnit amitmnnit commented Sep 3, 2013

Thanks,

Loading

@jarl-dk
Copy link

@jarl-dk jarl-dk commented Dec 2, 2013

@othiym23 : Thanks for the details on ubuntu/debian...

Loading

@ebuildy
Copy link

@ebuildy ebuildy commented Dec 3, 2013

I had to append /usr/bin to PATH in my PHP code :

putenv('PATH=' . getenv('PATH') . ':/usr/local/bin:/usr/bin');

Loading

@kevbob1
Copy link

@kevbob1 kevbob1 commented Dec 23, 2013

"update-alternatives --install /usr/bin/node node /usr/bin/nodejs 99"

this fixed it for me

Loading

@rlidwka
Copy link

@rlidwka rlidwka commented Dec 24, 2013

or just apt-get install nodejs-legacy

Loading

@rafee
Copy link

@rafee rafee commented Jan 5, 2014

rlidwka's solution is the one, I arrived. Except the fact, I didn't see it & gone through infinite suffering.

Loading

@rlidwka
Copy link

@rlidwka rlidwka commented Jan 5, 2014

rlidwka's solution is the one, I arrived. Except the fact, I didn't see it & gone through infinite suffering.

you sound like Zathras :)

Loading

@jadedgnome
Copy link

@jadedgnome jadedgnome commented Mar 14, 2014

i did :$ ln -s /usr/bin/nodejs /usr/bin/node

Loading

@rzr
Copy link

@rzr rzr commented Mar 22, 2014

sudo ln -fs /usr/bin/nodejs /usr/local/bin/node

Loading

@rom5jp
Copy link

@rom5jp rom5jp commented Oct 20, 2015

digitalmediums,
That was useful, thanks a lot!

Loading

@ghost
Copy link

@ghost ghost commented Oct 25, 2015

Thank you, it worked for me!

Loading

@dunnleaddress
Copy link

@dunnleaddress dunnleaddress commented Nov 17, 2015

@digitalmediums you are right till now. thank you!
"if you install from a package manager you bin may be called nodejs so you just need to symlink it like so "ln -s /usr/bin/nodejs /usr/bin/node""

Loading

@chrissilkey
Copy link

@chrissilkey chrissilkey commented Nov 29, 2015

Great!, thanks for the post

Loading

@mattbrosenberg
Copy link

@mattbrosenberg mattbrosenberg commented Dec 1, 2015

Symlink worked great for Debian deploy, thanks!

Loading

@CruiseDevice
Copy link

@CruiseDevice CruiseDevice commented Dec 18, 2015

sudo apt-get install nodejs-legacy
worked :) 👍

Loading

@leemke
Copy link

@leemke leemke commented Jan 21, 2016

sudo apt-get install nodejs-legacy worked :)

Loading

@fgesora
Copy link

@fgesora fgesora commented Jan 26, 2016

Some Linux distributions installs NodeJS as nodejs and not node. Simply create a link as
ln -s /usr/bin/nodejs /usr/bin/node

Loading

@iranalves85
Copy link

@iranalves85 iranalves85 commented Jan 27, 2016

thanks, my npm is working now.

Loading

@theblackhole
Copy link

@theblackhole theblackhole commented Jan 28, 2016

@fgesora 's solution works for me, thanks 👍 (I use nvm)

Loading

@thfontaine
Copy link

@thfontaine thfontaine commented Jan 28, 2016

Thanks, worked for me =)

Loading

@alexanderbezverhni
Copy link

@alexanderbezverhni alexanderbezverhni commented Mar 11, 2016

Loading

@aeolusheath
Copy link

@aeolusheath aeolusheath commented Mar 17, 2016

Loading

@wellington1993
Copy link

@wellington1993 wellington1993 commented Apr 14, 2016

Loading

@matheushf
Copy link

@matheushf matheushf commented Apr 21, 2016

dude, thanks! @digitalmediums

Loading

@iamtodor
Copy link

@iamtodor iamtodor commented Apr 21, 2016

@digitalmediums you are the great guy! This shitty issue still happens almost 4 yeah later.. (:

Loading

@arachchi
Copy link

@arachchi arachchi commented Apr 26, 2016

thanks for the help

Loading

@curly-hub
Copy link

@curly-hub curly-hub commented May 4, 2016

I expected them to fix it after 3 years....

Loading

@rpulijala
Copy link

@rpulijala rpulijala commented May 5, 2016

Wow, this issue has been since last 4 years... well thats interesting

Loading

@Li-ReDBox
Copy link

@Li-ReDBox Li-ReDBox commented May 11, 2016

I found this amazing and shocking. Really lack of caring.

Loading

@bnoordhuis
Copy link
Member

@bnoordhuis bnoordhuis commented May 11, 2016

For people coming here through search engines, the correct solution is #3911 (comment) or #3911 (comment).

To the last three commenters: If you are unhappy that Debian decided to call the binary nodejs instead of node, complain to Debian. Griping about it here won't help.

Locking.

Loading

@nodejs nodejs locked and limited conversation to collaborators May 11, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet