Node Version Manager (nvm) overview
May 9, 2024nvm
facilitates switching between different Node versions across projects. This post covers its overview from installation to version management.
Installation
To install nvm
, execute the following commands in your terminal. This example uses zsh
, but the process is similar for other shells like bash
.
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bashsource ~/.zshrc
Version management
Install the specific version. Including the
v
prefix is optional.nvm install v21.7.2Install the latest version
nvm install nodeInstall the latest one for the specified major version
nvm install 22Switch to a specific installed version
nvm use 21Add
.nvmrc
file inside the project directory and runnvm use
command to use the specified installed version.v21.7.2Get the list of locally installed versions
nvm lsGet the list of available versions for installation
nvm ls-remote
Boilerplate
Here is the link to the template I use for the development.