
nvm
A command-line tool to install and switch between multiple Node.js versions on Mac, Linux, and WSL.
- Stars
- 95.7k
- Forks
- 10.7k
- Licence
- MIT
- Language
- Shell
- Last update
- 8 days ago
- Type
- Dev tool
What it is
nvm is a small shell script that lets you install several versions of Node.js on one computer and switch between them from the terminal. It is installed per user and loaded in each shell session. People use it when different projects need different Node.js versions.
- Install Node.js 24 and Node.js 22 side by side and switch between them with nvm use
- Put a .nvmrc file in a project folder so the right Node.js version is selected for that project
- Set a default Node.js version that new shells start with
- Install global npm packages per Node.js version, or migrate them when installing a new version
Great for
- Developers who work on several Node.js projects that need different versions
- People on macOS, Linux, or Windows WSL who use a POSIX-compatible shell like bash or zsh
- Teams that pin a version in a .nvmrc file so everyone runs the same Node.js version
- Beginners who want a simple way to try a specific Node.js release
Not ideal for
- Windows users running native PowerShell or cmd without WSL, since the README only describes unix, macOS, and WSL support
- People who only need one Node.js version and never switch, since a system install or a direct download may be simpler
- Environments that cannot run shell scripts or need a fixed, prebuilt binary without an installer step
How to get it
- 1
Clone and build from source
You'll need: A POSIX-compatible shell such as bash or zsh · curl or wget, or git, for the installer
Install or update nvm (cURL)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.8/install.sh | bashInstall or update nvm (Wget)
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.8/install.sh | bash - 2
Run it
- Run the install command, then open a new terminal or reload your shell profile
- Run nvm install 24 to install Node.js 24
- Run nvm use 24 and then node -v to confirm the active version
- Run nvm use 22 to switch to a different installed version
- 3
Get the most out of it
- Add a .nvmrc file to a project and run nvm use in that folder to match the project's Node.js version
- Set a default version so new shells start with the one you choose
- Use the NVM_DIR and XDG_CONFIG_HOME variables to control where nvm files are stored
- Set PROFILE=/dev/null during install if you already load nvm from a plugin such as the zsh nvm plugin for Oh My Zsh
Downloads
Strengths
- Lets you keep several Node.js versions installed and switch between them quickly
- Works with common POSIX shells such as bash, zsh, dash, and ksh, per the README
- MIT licensed and widely used, with a large and active open-source community
Trade-offs
- It is a shell script rather than a native app, so behavior depends on your shell setup and profile files
- The README notes Windows support is through WSL, not native Windows
- Setup involves editing shell profile files, which can be confusing for beginners
How it compares
| Project | Stars | Type | Level | Updated | Best for |
|---|---|---|---|---|---|
| nvm (this) | 95.7k | Dev tool | beginner | 8 days ago | Developers who work on several Node.js projects that need different versions |
| n | 19.5k | CLI | beginner | 19 days ago | Developers who work on projects that need different Node.js versions |
| asdf | 25.6k | Dev tool | beginner | 5 days ago | Developers who work on several projects that need different language versions |
| nvm | 48.1k | App | beginner | 4 days ago | Windows developers who work on several Node.js projects that need different versions |
| zoxide | 40.4k | Dev tool | beginner | 4 days ago | Developers who move between many project folders in a terminal |
| atuin | 32.2k | Dev tool | beginner | 4 days ago | Developers who work in a terminal and often need to find past commands |
Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.