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

You can install the latest long term support version.

nvm install --lts

Or, a specific version.

nvm install 16.3.2

Set default version

nvm alias default <version>

List installed versions

nvm ls

Sources

Tagged: Node.js

Leave a comment

Your email address will not be published. Required fields are marked *