Tim Habersack

/usr/bin/env: node: No such file or directory

If you are getting this error, odds are you are trying to run something nodejs related on a Ubuntu/Debian Linux distro and having problems.

I was having this problem, then found this excellent help from StackOverflow:

sudo ln -s "$(which nodejs)" /usr/bin/node

You need to symlink the nodejs executable to node

The reason for this is that when you do “apt-get install node”, it installs an unrelated package, so they had to choose a different name so it wouldn’t conflict

Ubuntu/Debian install node as nodejs, so it doesn’t conflict with node, a package of the same name.

What makes this hard to deduce is if you install nodejs by:

sudo apt-get install npm

Which will install npm and nodejs. The npm will know where node is, so you can install things via npm install but then if you try to run something you installed, like grunt, you’ll get the above error.

Categories: Coding

Happy Surprise; Sword Art Online Progressive books » « Stop fighting and embrace the JS


  1. Thanks, it really helped me a lot

  2. Thanks for the post Tim – it is very useful.

  3. Thanks! You saved a lot of hair that I was about to pull out from my head!


Leave a Reply

Your email address will not be published.


Copyright © 2019 Tim Habersack

Theme by Anders NorenUp ↑