Installation of Node.js and NPM in Centos 7

Prerequisites:-

To follow this guide, you will need an Ubuntu 20.04 server set up

Install Node from the EPEL Repository

update && upgrade server

$ yum update -y && yum upgrade -y

Accessing the EPEL Repository

To access the Extra Packages for Enterprise Linux (EPEL) repository, you need to adjust your system's repository settings. This can be easily done by installing the epel-release package from your current repositories. This package configures your system to access the EPEL repo.

$ sudo yum install epel-release -y

Having added the EPEL repository, you can now install Node.js via your standard yum commands:

$ sudo yum install nodejs -y

To confirm the installation was successful, you can ask Node to display its version number:

$ node --version

To manage Node packages, you'll likely need npm, which can be installed from EPEL with the following command:

$ sudo yum install npm -y

To confirm the installation was successful, you can ask npm to display its version number:

$ npm --version

Last updated