install node.js on centos 5 6 7

2018/07/10
how to install node.js on linux



for Node.js v8 LTS:

curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -


for Node.js 10:


curl --silent --location https://rpm.nodesource.com/setup_10.x | sudo bash -


to install


sudo yum -y install nodejs



to check install success


node --version

you must show
v8.?.? or v 10.?.?


npm -v

6.?.?




notes:

will work on
Red Hat® Enterprise Linux®
RHEL
CentOS
Fedora.