Node can be installed on a shared hosting account if you have SSH but no root access. Using Node Version Manager (NVM) makes it easy to install and manage different node versions.
Here’s the NVM project page:
https://github.com/creationix/nvm
To install get the curl or wget command from here:
https://github.com/creationix/nvm#install-script
Will be something like:
1 |
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash |
The install may advise you to create or update your .bash_profile with something like:
1 2 |
export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm |
Immediately after install you may need to run:
1 |
source ~/.bash_profile |
Now you can use NVM to:
List available node version:
1 |
nvm list-remote |
Install node version:
1 |
nvm install 10.15.0 |
List locally installed version:
1 |
nvm list |
Use node version:
1 |
nvm use v0.10.30 |
Set the default version:
1 |
nvm alias default v0.10.30 |