Last Updated:

Install node js : linux

Install node js
 

Node.js - Java Script code execution environment.
 
It is built on the V8 engine and is written in C++.

V8 engine is a high-performance javascript engine that translates javascript into machine code.

Node Js runs on both linux and Windows operating systems and can be used to create fast and scalable applications.

This tutorial will describe: How to install nodejs on linux.

By default, Linux Ubuntu 16.04 and Ubuntu 18.04 come with the latest version of NodeJs.

But if you have a different Linux distribution or need a different version of NodeJs, then you will have to add another PPA repository.

Before you can add another repository, you must install CURL.

Install Curl as follows:
Open the terminal and run the command -

After installing CURL add the repository:

The required version of NodeJs is specified in the PPA address of the repository.
Therefore, if you need to install NodeJs of a different version, then change the version number in the PPA.

Example (Adding a PPA to install NodeJs version 8):

Once the required repository has been added, let's proceed to install Node Js:

This recipe described how to quickly install nodeJs of the required version on Linux.
Detailed information about NodeJs itself you can see on the official website.
sudo apt-get install curl
curl -sL https://deb.nodesource.com/setup_10.x | sudo bash -
curl -sL https://deb.nodesource.com/setup_8.x | sudo bash -
sudo apt-get install nodejs