JavaScript: How to install Node.js on Ubuntu Linux

To install Node.js version 6.x on Ubuntu Linux VM, start by going here:
https://nodejs.org/

Click on the DOWNLOADS link at the top, then click on the “Installing Node.js via package manager” link. Then under “Debian and Ubuntu based Linux distributions“, there are two commands to use. Run these commands, in order, in the Ubuntu terminal. Copy and paste these commands one at a time.

Command #1:

curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -

The terminal output will look something like this:

When this completes, run the second command.

Command #2:

sudo apt-get install -y nodejs

The terminal output will look something like this:

To double check that Node.js version 6.x was installed, you can run this command in the Ubuntu terminal:

node --version

Leave a Reply