How to Install Nodejs and NPM on Centos CWP and VestaCP

by Sandeep B.

Today in this tutorial we’ll be installing node.js and npm on centos based server eg, cwp, vestacp, cpanel, webmin etc. Node.js is a JavaScript runtime built on Chrome’s V8 JavaScript engine. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient.

STEP 1 :

Run as root on RHEL, CentOS, CloudLinux or Fedora:

Install build tools, this tools are necessary for the nodejs installation:

yum install gcc-c++ make
OR
yum groupinstall 'Development Tools'

Now enable node.js yum repository :

To install NodeJS 13.x

curl -sL https://rpm.nodesource.com/setup_13.x | bash -

To install NodeJS 12.x

curl -sL https://rpm.nodesource.com/setup_12.x | bash -

To install NodeJS 10.x

curl -sL https://rpm.nodesource.com/setup_10.x | bash -

To install NodeJS 8.x

curl -sL https://rpm.nodesource.com/setup_8.x | bash -

To install NodeJS 6.x

curl -sL https://rpm.nodesource.com/setup_6.x | bash -

STEP 2 :

Now we’re going to install node.js and NPM:

yum install nodejs -y

To check the version of npm and node.js run this commands :

[root@mysterydata ~]# npm -v
6.14.4

[root@mysterydata ~]# node -v
v12.16.3

If this post helps you in any way please consider a donation

Donate with PayPal :

md-donate

You may also like

2 comments

Dinh Le Giang May 31, 2019 - 10:23 pm

Hi! Thanks for your tuts.
Nodejs go with mongodb
Can you known me how to install mongodb on vestaacp

Reply
Sandy June 1, 2019 - 10:10 am Reply

Leave a Comment