Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running node.js server on Ubuntu using forever

I'm trying to use the 'forever' node.js package to run a node.js service on Ubuntu. Seems like it should be straightforward. However, when I run it, I receive the following output:

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

I think this may be because the Ubuntu package manager names the node.js binary nodejs, rather than node, which is more standard. Is there a way to tell the forever package where to find node?

(I did try symlinking /usr/bin/node to /usr/bin/nodejs, but that produced even more errors and it feels like a hack anyway)

like image 619
andypaxo Avatar asked Oct 21 '22 16:10

andypaxo


1 Answers

Have you tried installing the latest node from source?

git clone https://github.com/joyent/node.git
cd node
git checkout v0.8.22 #Try checking nodejs.org for what the stable version is
./configure
make
sudo make install

This video isn't entirely clear, but the author implies that older versions of node in the Debian repository are behind the node/nodejs naming issue.

Alternatively, you could try finding the target of the /usr/bin/nodejs symlink using any of the methods described here and create a /usr/bin/node symlink to that.

Good luck!

like image 75
John Henry Avatar answered Oct 27 '22 11:10

John Henry