"/usr/bin/env: ‘node’: No such file or directory" even though it is in PATH

Install nodejs8

curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs

Install nodejs10

curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs

Then try again with node


Usually this is a simple naming problem, when you install from a package manager your bin file may be called nodejs so you just need to symlink it using the command:

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

Tags:

Npm

Nodejs

16.04