Install Node JS and NPM on Linux (CentOS/Ubuntu)

Hi Friends! Today we will learn the easiest way to install Node JS and NPM on Linux (CentOS/Ubuntu). Let’s Start we go Step by Step.

install node js, install node js Ubuntu, install node js centos, install node js Linux, install node and npm, install npm and node, install npm Ubuntu, install npm on centos
install node and npm

Go for the Quick View but please come and read the whole post so that you can get more information and Knowledge about the installation of NodeJS and NPM on Linux.

Installation of Node JS and NPM on Ubuntu
$sudo apt-get install curl

So if you want to install the lower version or the higher version of the Node JS just makes the changes in URL.

Suppose you want to install version 10 the link will be like this “https://deb.nodesource.com/setup_10.x.

We have to install version 13 so URL will be “https://deb.nodesource.com/setup_13.x.

So just replace that with the below command.

$curl -sL https://deb.nodesource.com/setup_12.x |sudo -E bash -
$sudo apt-get install -y nodejs
$node -v 
$npm -v 
Installation of Node JS and NPM CentOS.
#sudo yum install curl

So if you want to install the lower version or the higher version of the Node JS just makes the changes in URL.

Suppose you want to install version 10 the link will be like this “https://rpm.nodesource.com/setup_10.x “.

If we have to install version 13 so URL will be “https://rpm.nodesource.com/setup_13.x “.

Just replace that with the below command

$sudo curl -sL https://rpm.nodesource.com/setup_12.x |sudo bash -
$sudo yum install -y nodejs
$node -v 
$npm -v 

If you have curl package installed, you can directly view the Install Node JS and NPM.

As we know till date the Long Term Support for the NodeJS is 12.x and the current stable version is 13.x.

STEP 1: Install the curl command so that we can install NodeJS

DEB Package:

$sudo apt-get install curl

RPM Package:

#sudo yum install curl

Install NODE JS and NPM

STEP 2.1: Install nodeJs on Ubuntu.

DEB Package:

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

Want to install the lower version or the higher version of the Node JS just make the changes in URL.

Suppose you want to install version 10 the link will be like this “https://deb.nodesource.com/setup_10.x “.

So we have to install version 13, so URL will be “https://deb.nodesource.com/setup_13.xJust replace that with the above command

The Above command will add and update the repo, After that, it will say to run the `sudo apt-get install -y nodejs` on the Output part.

$sudo apt-get install -y nodejs

This will install node and npm in the Debian Distributors, Now the same process we will look into the REDHAT Distributors.

STEP 2.2: Install nodeJs on CentOS.

RPM Package:

$sudo curl -sL https://rpm.nodesource.com/setup_12.x | sudo bash -

Want to install the lower version or the higher version of the Node JS just make the changes in URL.

Suppose you want to install version 10 the link will be like this “https://deb.nodesource.com/setup_10.x “.

So we have to install version 13, so URL will be “https://deb.nodesource.com/setup_13.xJust replace that with the above command

Same the Above command will add and update the repo and will say to run `sudo yum install -y nodejs` on the Output part.

$sudo yum install -y nodejs

So now we have seen the installation in both the distributors before we will move to next step just read this

Now there is the repository named as nodesource into the GitHub, Many of the contributors are there the are trying to make the Node installation better

You have seen in this step we used “|sudo bash -“ after the URL, Because for the installation of the packages, they have used SHELL Scripting. Wow, that’s great, you should go and check the reference link named as nodesource.

Step 3: Check the Version of installed Node and NPM

So, we will check the version on both the distributor commands is the same.

$node -v 
$npm -v 

Both the above command will give the output of the version that will be installed

Thanks for reading this post! For the Information of the Node JS, you can visit this POST.

Kindly give your valuable time to make the world better.

Install node js, install node js Ubuntu, install node js centos, install node js Linux, install node and npm, install npm and node, install npm Ubuntu, install npm on centos

Give your valuable time