To install Node.js on CentOS 6, run following commands as user root
curl --silent --location https://rpm.nodesource.com/setup_6.x | sudo bash - yum install -y nodejs
Once installed, you have node and npm available.
[root@s45-40-135-102 ~]# node --version v6.11.2 [root@s45-40-135-102 ~]# npm --version 3.10.10 [root@s45-40-135-102 ~]#
Now you can install required node modules with npm.