Skip to content

Instantly share code, notes, and snippets.

@mcnamee
Created August 8, 2018 22:30
Show Gist options
  • Save mcnamee/5965e24ec2de990068a603864b67e864 to your computer and use it in GitHub Desktop.
Save mcnamee/5965e24ec2de990068a603864b67e864 to your computer and use it in GitHub Desktop.
Upgrade NodeJS on Centos with Cagefs/cPanel

Clean up references to other node version packages

rm -f /etc/yum.repos.d/nodesource-el.repo
yum clean all

Remove Old Node version

yum -y remove nodejs
mv /usr/local/bin/node /usr/local/bin/node-OLD-v6
mv /usr/sbin/node /usr/sbin/node-OLD-v6
hash -r

Install node v10 (you can change the version number)

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

Copy the node files to a location for all cagefs users

ln -s /usr/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm
cp /usr/bin/node /usr/local/bin/node

Force Update cagsfs to update (instead of rebooting)

cagefsctl --force-update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment