nvm facilitates switching between different Node versions across projects. This post covers nvm-sh on macOS and Linux. For Windows, see the nvm for Windows post.
As of mid-2026, Node.js 24 is Active LTS, 22 is Maintenance LTS, and 26 is the Current release.
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.40.5/install.sh | bash
source ~/.zshrc
Version management
- Install the specific version. Including the
vprefix is optional.
nvm install v24.16.0
- Install the latest version
nvm install node
- Install the latest Active LTS release
nvm install --lts
- Install the latest one for the specified major version
nvm install 24
- Switch to a specific installed version
nvm use 24
- Add
.nvmrcfile inside the project directory and runnvm usecommand to use the specified installed version.
v24.16.0
- Get the list of locally installed versions
nvm ls
- Get the list of available versions for installation
nvm ls-remote
Need help with your project?
Get personalized advice on your architecture, code, or career in a 45-minute 1-on-1 consultation.
Top comments (0)