- switch to root user after ssh login
sudo -s
- Installed nvm in /opt/nvm
git clone https://github.com/creationix/nvm.git /opt/nvm
- Created the directory /usr/local/nvm. This is where the downloads will go ($NVM_DIR)
mkdir /usr/local/nvm
- Create the directory /usr/local/node. This is where the NPM global stuff will go:
mkdir /usr/local/node
- Created a file called nvm.sh in /etc/profile.d with the following contents:
export NVM_DIR=/usr/local/nvm
source /opt/nvm/nvm.sh
export NPM_CONFIG_PREFIX=/usr/local/node
export PATH="/usr/local/node/bin:$PATH"
- make nvm is available to me
source /etc/profile.d/nvm.sh
- Re-login to a shell session, then set the default node version.
nvm install node