I had Node.js 6.x installed and wanted to install Node.js 8.x.
Here's the commands I used (taken from Nodejs's site with a few extra steps to handle the yum cached data):
sudo yum remove nodejs
: Uninstall Node.js 6.x (I don't know if this was necessary or not)curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -
sudo yum clean all
sudo yum makecache
: Regenerate metadata cache (this wasn't in the docs, but yum kept trying to install Node.jx 6.x, unsuccessfully, until I issued these last two commands)sudo yum install nodejs
: Install Node.js 8.x