How to Install Node.js on CentOS 8

Install Node.js on CentOS 8

In this article, we will have explained the necessary steps to install Node.js on CentOS 8. Before continuing with this tutorial, make sure you are logged in as a user with sudo privileges. All the commands in this tutorial should be run as a non-root user.

Node.js is an open source cross-platform JavaScript run-time environment that allows server-side execution of JavaScript code which simply means that you can run JavaScript code on your machine as a standalone application, free of any web browser.

Npm, short for Node Package Manager is the default package manager for Node.js that helps developers to share and reuse their code. It also refers to the world’s largest software repository for the publishing of open-source Node.js packages

Install Node.js on CentOS

Step 1. The first command will update the package lists to ensure you get the latest version and dependencies.

Step 2. Install Node.js on CentOS.

Run the following command to install Node.js and NPM package manager on CentOS 8 from the official package repository:

Verify installtion of Node.js and npm running following command:

Also, check nvm version and confirm installation typing:

The same way, check whether NPX is working as follows:

Congratulation, you have learned how to install Node.js on CentOS 8. If you have any question, please leave a comment below.