Install nodejs on Centos

Install nodejs on CentOS for Node.js v8 LTS:

1. Get nodejs

 

[[email protected] ~]# curl --silent --location https://rpm.nodesource.com/setup_8.                                                                                                                     x | sudo bash -

 

2.Install nodejs

 

[[email protected] ~]# sudo yum -y install nodejs

 

3. To compile and install native addons from npm you may also need to install build tools:

 

[[email protected] ~]# sudo yum install gcc-c++ make

 

4.Check nodejs

 

[[email protected] ~]# node -v

v8.12.0

[[email protected] ~]# npm -v

6.4.1