Managing your node version can be handled fluidly with Node Version Manager(NVM). NVM is a powerful tool that can quickly amplify your node environment. Installing and using NVM does not require sudo/admin rights making it extremely accessible to all users within a Managed Server environment.
Getting Started with NVM
Step 1: Download and install NVM onto your user directory.
- NVM can easily be installed by running this command below.
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.1/install.sh | bash
Step 2: Export NVM to your local path.
- Export the NVM_DIR to your local path.
export NVM_DIR="$(cd ~/ || exit 1;pwd)/.nvm"
Step 3: Run the NVM scripts.
- Activate your NVM environment by running nvm.sh.
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
You may now install any version of node that you would like without needing sudo/admin rights. Enter the specific version you would like to have installed within this place holder[node_version]. Please note the command does not need brackets. Example: nvm install 14.17.0.
nvm install [node_version]