Install Node.js on Centos 7/8

Install Node.js on Centos 7/8

13 April 2021
Tutorial Linux Server

Download the install & execute it

To install the latest version of Node.js we should download the installer and execute it.

If we don't know the latest version of Node.js we can check it at the website of the project

curl -sL | sudo bash -

Once the command has finished we should install Node.js using yum.

yum install -y nodejs

Check the installed version

Once we have Node.js installed we can check the current version using the next command.

node -v

Install dependencies

If at some point we need to compile a Node.js dependency for our system, like SQLite, we should install the following.

yum install gcc-c++ make

Update NPM

After installing Node.js it's possible to have an outdated version of NPM, to update it we should execute the following command.

npm install -g npm