Instructions for installing Node.js 12 on CentOS 7

Introduction

Node.js is a JavaScript runner for server-side programming. It allows developers to create extensible backend functionality using JavaScript, a language many people are familiar with in browser-based web development.

In the article, we will show you how to install Node.js 12 on CentOS 7 simply and easily.

Install Node.js 12 on CentOS 7

To install Node.js 12 on CentOS 7 we follow these 3 steps.

Step 1: SSH into your CentOS 7 server

To install Node.js 12 on CentOS 7, we need to  SSH  or access your  VPS  or server with root privileges first.

After successfully  SSH, we continue with step 2 to perform the update of the CentOS operating system.

Step 2: Update CentOS

To update CentOS operating system we execute the following command.

yum update -y

Here is a picture after I finished updating. Depending on what internal software you use will have a different interface.

Screenshot 2021 09 08 at 09.19.41

After the update is successful, we continue with step 3 to execute the commands to install Node.js 12 on CentOS 7.

Step 3: Commands to install Node.js 12 on CentOS 7

We use the commands to install Node.js 12 on CentOS 7 as below. I will explain the commands right below so that you can clearly understand the function of each command.

curl -sL https://rpm.nodesource.com/setup_12.x | sudo bash - 
yum clean all && sudo yum makecache fast 
yum install -y gcc-c++ make 
yum install -y nodejs

Explanation of the above commands:

  • Command 1: This command will install the NodeSource Node.js 12.x repo.
  • Command 2: Clear all cache of yum command.
  • Command 3: Install the gcc-c++ make library.
  • Command 4: Install nodejs.

Below is the image after I have run the above 4 commands.

Install Node.js 12 on CentOS 7

So we have completed the installation of Node.js 12 on CentOS 7.

Now we use the following command to check the installed Node.js version.

node -v

And this is the result.

Install Node.js 12 on CentOS 7

Summary

Through this article, I showed you how to install Node.js 12 on CentOS 7 as well as check the version after the installation is complete.

Hope you can do it successfully.


Support 24/24h with coupon code: 1DOLLAROFF 10% discount. Click now! 👆
On this page