NVM

Node Version Manager allows you to use multiple diferent versions of node and switch between them easily.

Installation

NVM

$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.2/install.sh | bash

Be sure to completely restart your terminal before proceeding.

Node

$ nvm install --lts # most recent version with long term support
$ nvm install node  # most recent version without LTS

Usage

$ nvm use --lts
$ nvm use node

Specific Versions

$ nvm ls                # show all installed versions
$ nvm install xx.xx.x   # x's meaning the version numbers
$ nvm use xx.xx.x
$ nvm uninstall xx.xx.x

Set Default Node Version

$ nvm alias default xx.xx

References

  1. https://techstacker.com/run-multiple-node-versions-node-nvm/

Last modified: 202107021741