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 | sudo -E bash -

Stable Release:

curl -sL | 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

Check NPM version:

# output

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.