How-to
How to Install Node.js Locally with Node Version Manager (nvm)

Download the install script
Using curl, or wget, download the installation script. In the URL below make sure you replace v0.35.0
with the latest version of nvm.
curl -sL https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.0/install.sh -o install_nvm.sh
Source the new instructions NVM added to .bashrc
during the installation process. You can either exit and re-enter the shell console, or manually source your .bashrc
file. This file is almost always located at the root of your home directory.
source ~/.bashrc
As an alternate method, you can execute the new instructions in the same console to apply them immediately.
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
You can confirm the version of NVM that is running with the following command:nvm --version