How to add an alias “node” for “nodejs”

If you ever encounter this error message

run npm command gives error "/usr/bin/env: node: No such file or directory"

 

All you need to do is just run this command:

sudo apt-get install nodejs-legacy

 

For confirmation, run

node -v