Use the following command to upgrade the system and install some of the necessary packages for node. js.
Install Nodejs under Linux (Ubuntu) before installing Nodejs, if g++ make Libssl-dev is not installed, etc.,
1. Updating systems and Dependencies
Update system
$ sudo apt-get update
Update dependencies
$ sudo apt-get install make g++ Libssl-dev
2. Next, you can download and install the Nodejs.
Download latest Version https://nodejs.org/en/download/current/
Source Code Latest version is https://nodejs.org/dist/v6.6.0/node-v6.6.0.tar.gz
Download version
$ wget https://nodejs.org/dist/v6.6.0/node-v6.6.0.tar.gz
Extract
$ tar zxvf node-v6.6.0.tar.gz
$./configure
$ sudo make install
After installation, enter the following in the console:
$ node-v
Results: v6.6.0
You can see the installed Nodejs version number.
Note that non-root users, be sure to sudo, or finally because the permissions issue finally failed to install successfully
Install Nodejs under Linux (Ubuntu)