Steps to Upgrade Node.Js and install
install latest depedency
yum install gcc gcc-c++ make
make sure already install node js
yum install epel-release
yum install nodejs
Lets first check our Centos 6.x VPS’s GLIBCXX versions for compatible version
strings /usr/lib64/libstdc++.so.6 | grep GLIBC
Current NodeJs Version – First check current nodejs version on your system using following command. In my case it is v0.10.48
node -v
v0.10.48
Clean Cache Forcefully – Now clean all npm cache from your system forcefully.
sudo npm cache clean -f
you can bypass https using below commands:
npm config set strict-ssl false
or set the registry URL from https or http like below:
npm config set registry="http://registry.npmjs.org/"
Install n Module – After cleaning all cache from your system, now install n modules using npm command.
sudo npm install -g n
Install Nodejs – Let’s install or update latest nodejs version on your system using n module.
sudo n stable
or
sudo n [version.number]
Setup Binary Link – Now link your node binary with latest nodejs installed binary file using following command.
sudo ln -sf /usr/local/n/versions/node/11.8.0/bin/node /usr/bin/node
Check Nodejs Version – Finally recheck your nodejs version. You will find that it showing latest version on your system.
node -v
5.4.0
Top comments (0)