Cannot install NodeJs: /usr/bin/env: node: No such file or directory

Solution 1:

Doing a symlink solves the issue:

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

(My thanks and +1 vote to bodokaiser's answer).

Solution 2:

The issue is not with the version of node. Instead, it is the way NodeJS is installed by default in Ubuntu. When running a Node application in Ubuntu you have to run nodejs somethign.js instead of node something.js

So the application name called in the terminal is nodejs and not node. This is why there is a need for a symlink to simply forward all the commands received as node to nodejs.

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