sajad torkamani

Install NVM

export NVM_DIR="$HOME/.nvm" && (
  git clone https://github.com/nvm-sh/nvm.git "$NVM_DIR"
  cd "$NVM_DIR"
  git checkout `git describe --abbrev=0 --tags --match "v[0-9]*" $(git rev-list --tags --max-count=1)`
) && \. "$NVM_DIR/nvm.sh"

This will clone the NVM git repo into $HOME/.nvm and run its installer.

Install Node version

nvm install --lts # latest long term support version
nvm install 16.3.2 # or a specific version

Set default version

nvm alias default <version>

Sources

Tagged: Node.js