Home Linux Server How to install Node.js 16 on CentOS 7

How to install Node.js 16 on CentOS 7

by Thạch Phạm
Published: Last Updated on
A+A-
Reset

In today’s article, AZDIGI will show you how to install Node.js 16 on CentOS 7 simply and easily.

This article is also applicable when you are running DirectAdmin. You just need to give the end user SSH permission to use Node.js.

I. What is Node.js?

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.

And now the latest Node.js version is Node.js version 16.

II. How to install Node.js 16 on CentOS 7

To install Node.js 16 on CentOS 7, we need to do the following 4 steps.

Step 1: SSH into your CentOS 7 server

To install Node.js 16 on CentOS 7, we first need to SSH or access your VPS/server as root. If you don’t know how to SSH into your VPS/Server, you can refer to the following tutorial:

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:

AZDIGI Tutorial
yum update -y
    

Below is my interface after I finished updating CentOS. Depending on the internal software you use, the interface will be different.

image 12

After updating the software, we continue with step 3 to execute the commands to install Node.js 16 on CentOS 7.

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

We use the commands to install Node.js 16 on CentOS 7 as below: I will explain the function of each command below:

AZDIGI Tutorial
yum install -y gcc-c++ make 
curl -sL https://rpm.nodesource.com/setup_16.x | sudo -E bash - 
sudo yum install -y nodejs
    

Explanation of the above commands:

  • Command 1: Install the gcc-c++ make library.
  • Command 2: This command will install the NodeSource Node.js 16.x repo.
  • Command 3: Install nodejs. NPM will also be installed with node.js. This command will also install many other dependent packages on your system.

Below are the images after I have run the above commands.

image 13
  • Command 1: Install the gcc-c++ make library.
  • image 14
  • Command 2: This command will install the NodeSource Node.js 16.x repo.
  • image 15
  • Command 3: Install nodejs.
  • It’s quite simple, isn’t it? At this point, we have successfully installed Node.js 16 on CentOS 7.

    Step 4: Check the Node.js and NPM version

    After installing node.js, let’s verify and check our installed version. You can find more details about the current version on the official node.js website.

    Below are two commands for us to check Node.js and NPM versions:

    AZDIGI Tutorial
    node -v
    Và
    npm -v 
        

    And here are my results: Maybe later you install, the version will be a little higher than this version of mine.

    image 17

    III. Summary

    So AZDIGI has complete instructions on installing Node.js 16 on CentOS 7 and checking the version after the installation process.

    Wishing you success! See more useful articles about VPS at the following link:

    If you need assistance, you can contact support in the ways below:

    Đánh giá

    Tham gia nhóm hỗ trợ Server - Hosting

    Tham gia nhóm Hỗ trợ Server - Hosting & WordPress để cùng nhau hỏi đáp và hỗ trợ các vấn đề về WordPress, tối ưu máy chủ/server.

    Tham gia ngay

    Bài viết cùng chuyên mục

    AZDIGI – Không chỉ là đơn vị hàng đầu trong lĩnh vực Web Hosting và Máy chủ, chúng tôi mong muốn mang lại những kiến thức bổ ích nhất và luôn cập nhật thường xuyên cho cộng đồng người đam mê thiết kế website, công nghệ,…

    Vui lòng không sao chép nội dung nếu chưa xin phép. Designed and Developed by PenciDesign