Installation of Node js in Linux CentOS and Ubuntu

Hi Friends! Today we will learn the easiest way for Installation of Node js in Linux CentOS and Ubuntu. Let’s Start we go Step by Step.

Installation of Node js in Linux CentOS and Ubuntu
Installation of Node js

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 Node JS 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 in 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: Installation of curl command so that we can install Node JS

DEB Package:

$sudo apt-get install curl

RPM Package:

#sudo yum install curl

Installation of NODE JS and NPM

STEP 2.1: Installation of Node JS on Ubuntu.

DEB Package:

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

So 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

Also 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

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

STEP 2.2: Installation of Node JS 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

Also 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

So 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.

Installation of node js, install node js Ubuntu, Install node js in centos, install node js Linux, install node and npm, install npm and node, install npm Ubuntu, install npm on centos

Give your valuable time