On an Ubuntu server you can install the Distro stable version of Node.js via the terminal by running
sudo apt-get update
sudo apt-get install nodejs
Once that’s complete you will want to install the Node.js Package Manager (NPM)
sudo apt-get install npm
Once that’s all installed we can test the installation.
Create a file anywhere on your server called hello.js
in the file write the following:
Then back on the terminal run
The terminal should echo out “Hello World” note we’re typing “nodejs” and not just “node”. It’s called nodejs because node conflicts with an old Ubuntu package.
Posted by Adi on October 28, 2016