How To Install Node.Js And NPM On Shared WHM/CPanel Hosting Account via SSH

Published: 14/05/2019

I've noticed that this is a common query among website owners and/or developers. People need to be able to run various JavaScript tasks on a shared hosting environment so I decided to write this short step by step guide.

First of all make sure you have SSH access to the server. (This is covered elsewhere online)

Install NVM And The Latest Stable Version Of Node.Js

  • Navigate to the NVM repository and get the latest version number from there. Then put it in the command below by replacing VERSION_NUMBER with the most recent version number from Github and execute the command: curl https://raw.githubusercontent.com/creationix/nvm/VERSION_NUMBER/install.sh | bash
  • If successful, you will see a bunch of messages showing how to initially configure NVM. Now you need to load NVM by issuing this command: source ~/.bashrc
  • Finally installing Node JS is done by running nvm install --lts which will install the latest stable version of Node.JS and NPM.
  • To test type nvm use --lts and then you can issue node -v to see the installed version.
How To Install Node.Js And NPM On Shared WHM/CPanel Hosting Account via SSH