Intro

NVM is a tool to install, switch between, and manage multiple installations of Node.js on the same machine. This is useful for working on projects that have different version requirements or for testing on various Node.js environments.

9/4/25

NVM Installation

https://www.freecodecamp.org/news/node-version-manager-nvm-install-guide/

Windows

TODO

Linux and Mac

  • Run the nvm installer and then reload the shell
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
  • Reload the shell
source ~/.bashrc    # or ~/.zshrc depending on your shell
  • verify installation
nvm -v

Installing Node.js via NVM

  • Install current release of Node.js
nvm install node
  • Install the current stable LTS release of Node.js (recommended for production applications) 1
nvm install --lts
  • see all versions managed by NVM
nvm ls
->     v22.20.0
        v25.0.0
         system
default -> node (-> v25.0.0)
iojs -> N/A (default)
unstable -> N/A (default)
node -> stable (-> v25.0.0) (default)
stable -> 25.0 (-> v25.0.0) (default)
lts/* -> lts/jod (-> v22.20.0)
  • Install a specific version of node
nvm install 22
  • Use a specific version
nvm use 22
  • Set a version as default
nvm alias default 22
  • Verify Node and npm are available
node -v
npm -v

Footnotes

  1. https://learn.microsoft.com/en-us/windows/dev-environment/javascript/nodejs-on-wsl