NodeJS on Raspberry Pi named NodeJS Instead of Node

So you followed the instructions and installed nodejs from the repositories on wheezy. The problem is, there’s already a package named node in the sources. So according to binary naming convention, nodeJS gets renamed to “nodejs”.

You can tell if you have this problem by simply typing

node -v

# then type

nodejs -v

If you get an error for the first and a version number for the second, your process is named “nodejs” instead of “node”. Which really isn’t a problem except that alot of scripts rely on “node” instead of the former. Packages like forever expect your process to be named node.

To fix this you simply need to link the nodejs process to node:

update-alternatives --install /usr/bin/node node /usr/bin/nodejs 10

If you run this command under sudo, you should be able to enter

node -v

In the command line and get a version number back (as of writing this, the wheezy distro allows for 0.6.19).

Leave a Reply

Your email address will not be published. Required fields are marked *