How to Install Nodejs and NPM on Centos CWP and VestaCP

by Sandy

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 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
5.6.0

[root@mysterydata ~]# node -v
v10.1.0

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

Donate with PayPal :

md-donate

Donate with Paytm :

md-donate

You may also like

2
Leave a Reply

avatar
1 Comment threads
1 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
2 Comment authors
SandyDinh Le Giang Recent comment authors
  Subscribe  
newest oldest most voted
Notify of
Dinh Le Giang
Guest

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