Install Latest Node.js on CentOS / RHEL 7

In this guide, I’m going to show how to install the latest Node.js on CentOS or RHEL 7. Let’s follow these steps:

Table of Contents

  1. Add Node.js Repository
  2. Install Node.js
  3. Check Node.js and NPM Version

Step 1 : Add Node.js Repository

At first, we need to add the Node.js repository in the machine. Let’s add Node.js repo from their official website.

Before adding repository install gcc-c++ make using this command:

yum install -y gcc-c++ make-

Latest Release:

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

Stable Release:

curl -sL https://rpm.nodesource.com/setup_10.x | sudo -E bash -

Step 2 : Install Node.js

We have added the Node.js repository. Now we can install Node.js including NPM using this command:

sudo yum install nodejs

Step 3 : Check Node.js and NPM Version

After successful installation, let’s check the Node.js version using this command:

node -v
# output
v10.16.3

Check NPM version:

npm-v
# output
6.9.0

That’s all.Thanks for reading.


Software Engineer | Ethical Hacker & Cybersecurity...

Md Obydullah is a software engineer and full stack developer specialist at Laravel, Django, Vue.js, Node.js, Android, Linux Server, and Ethichal Hacking.