Repolode
nvm-sh

nvm-sh/nvm

A POSIX-compliant bash script for installing and switching between multiple Node.js versions per user and per shell.

Stars
95,597
Forks
10,577
Open issues
387
Last commit
11 days ago

What is it?

nvm is a command-line version manager for Node.js. It installs Node.js releases into a per-user directory, lets you switch the active version with a single command, and keeps separate sets of globally installed npm packages for each version. It is loaded as a shell function, so it works in sh, bash, zsh, dash and ksh rather than as a standalone binary.

Beyond installing and switching, nvm supports LTS aliases such as lts/*, an .nvmrc file that pins a project's Node version, and commands to run a single command under a given version without changing the active one. It also supports offline installs from cached downloads, custom download mirrors, and migrating global packages when installing a new version.

The project targets Linux, macOS and Windows through WSL, and works with Git Bash or Cygwin. Fish is not supported; the README lists third-party alternatives for that shell.

Key features

  • 01Install, switch, and uninstall multiple Node.js versions per user
  • 02Reference LTS releases with aliases like lts/* in commands and .nvmrc
  • 03Pin a project's Node version with an .nvmrc file
  • 04Run a command under a specific Node version without changing the active one
  • 05Migrate global npm packages when installing or between installed versions
  • 06Use a custom mirror for Node binaries

Use cases

  • Working on several projects that require different Node.js versions
  • Pinning a team's Node version through an .nvmrc file in the repository
  • Setting up Node.js in Docker or CI jobs without a system-wide install
  • Installing Node.js on a machine without network access using cached downloads

Quick start

  1. 1

    Run the install script with curl (review it first or use the official install command from the README)

  2. 2

    Load nvm in your shell profile, then install a Node.js version

    nvm install 24
  3. 3

    Switch to an installed Node.js version

    nvm use 22

Things to know

  • Not supported on native Windows; use WSL, Git Bash, or Cygwin instead.
  • Fish shell is not supported.

Topics

FAQ

What is nvm?
A POSIX-compliant bash script for installing and switching between multiple Node.js versions per user and per shell. nvm is a command-line version manager for Node.js. It installs Node.js releases into a per-user directory, lets you switch the active version with a single command, and keeps separate sets of globally installed npm packages for each version. It is loaded as a shell function, so it works in sh, bash, zsh, dash and ksh rather than as a standalone binary.
Is nvm free to use? What license does it have?
nvm is open source under the MIT license. Check the license terms before using it in commercial products.
Is nvm still maintained?
Actively maintained. The last commit to nvm was on Oct 10, 2026.
What can I use nvm for?
Working on several projects that require different Node.js versions Pinning a team's Node version through an .nvmrc file in the repository Setting up Node.js in Docker or CI jobs without a system-wide install Installing Node.js on a machine without network access using cached downloads
How do I install nvm?
Run the install script with curl (review it first or use the official install command from the README) Load nvm in your shell profile, then install a Node.js version: nvm install 24 Switch to an installed Node.js version: nvm use 22
Where can I get nvm?
The source code and installation instructions are on GitHub: https://github.com/nvm-sh/nvm

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects