Skip to content

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
Step-by-step guide: how to use nvmInstall, first run, examples, tips and FAQs

How to get it

  1. 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 | bash

    Install or update nvm (Wget)

    wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.8/install.sh | bash
  2. 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. 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

ProjectStarsTypeLevelUpdatedBest for
nvm (this)95.7kDev toolbeginner8 days agoDevelopers who work on several Node.js projects that need different versions
n19.5kCLIbeginner19 days agoDevelopers who work on projects that need different Node.js versions
asdf25.6kDev toolbeginner5 days agoDevelopers who work on several projects that need different language versions
nvm48.1kAppbeginner4 days agoWindows developers who work on several Node.js projects that need different versions
zoxide40.4kDev toolbeginner4 days agoDevelopers who move between many project folders in a terminal
atuin32.2kDev toolbeginner4 days agoDevelopers 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.