Marc Rasmussen Marc Rasmussen - 11 months ago 170
Node.js Question

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

I have installed nodejs using:

apt-get install nodejs

Then i have installed npm using:

apt-get install npm

And then i have installed forever using:

npm install forever -g

Now i go to my project

and attempt to run
forever start server.js

then i get the following message:

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

Can anyone tell me whats going on?


You need to symlink the nodejs executable to node

sudo ln -s "$(which nodejs)" /usr/bin/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