Node.js is a platform built on Chrome’s JavaScript runtime for easily building fast, scalable network applications.
Step 1 – Add node.js PPA
Node.js package is available in LTS and current release.
Use the current release:- in your case if there is any further version available then replace the 12 with your desired version.
$ sudo apt-get install curl python-software-properties
$ curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash
Use LTS release:- in your case if there is any further version available then replace the 10 with your desired version.
$ sudo apt-get install curl python-software-properties
$ curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
Step 2 – Install node.js on Ubuntu
You have successfully added the node.js PPA now execute the blow command to install the software.
$ sudo apt install nodejs
Step 3 – Checking your version
Now execute below two commands to check node.js and npm version. In my case I am using the LTS version.
$ node -v
v10.16.0
$ npm -v
6.9.0
Thank you 🙂