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

Eduardo Dennis picture Eduardo Dennis · Jan 2, 2014 · Viewed 61.2k times · Source

I installed node js and npm via apt-get install and all of the dependencies, then I installed browserify

npm install browserify -g

it goes through the process and it seems like it installed correctly, but when I try to do a simple bundle per this walkthrough

I get the error:

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

enter image description here

Answer

bodokaiser picture bodokaiser · Jan 2, 2014

Some linux distributions install nodejs not as "node" executable but as "nodejs".

In this case you have to manually link to "node" as many packages are programmed after the "node" binary. Something similar also occurs with "python2" not linked to "python".

In this case you can do an easy symlink. For linux distributions which install package binaries to /usr/bin you can do

ln -s /usr/bin/nodejs /usr/bin/node