explaingit

nvm-sh/nvm

🔥 Hot93,419ShellAudience · developerComplexity · 2/5ActiveLicenseSetup · easy

TLDR

Command-line tool to install and switch between multiple Node.js versions on one computer, letting you pick the right version for each project.

Mindmap

mindmap
  root((nvm))
    What it does
      Install Node versions
      Switch between versions
      Auto-detect per project
    How to use
      nvm install command
      nvm use command
      .nvmrc config file
    Installation
      Shell script setup
      Docker support
      Manual install
    Use cases
      Multi-project setup
      Bug reproduction
      CI/CD pipelines

Things people build with this

USE CASE 1

Switch between Node.js versions when working on multiple projects with different requirements.

USE CASE 2

Reproduce bugs that only appear on a specific Node.js version without reinstalling.

USE CASE 3

Set up CI/CD pipelines to test code against multiple Node versions automatically.

USE CASE 4

Automatically use the correct Node version for a project by reading its .nvmrc file.

Tech stack

ShellPOSIXBashZshNode.js

Getting it running

Difficulty · easy Time to first run · 5min
Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

In plain English

nvm, short for Node Version Manager, is a command-line tool that lets a developer install many different versions of Node.js on the same computer and switch between them with one command. Node.js is a runtime that lets JavaScript code run outside a web browser, used to build servers, command-line tools, and other JavaScript-based software. Different projects often expect different Node versions, and nvm makes it possible to keep all of them ready and pick the right one for whichever project is currently open. The README describes nvm as a POSIX-compliant shell script, meaning a small program written in shell language that works under sh, dash, ksh, zsh, and bash on Unix, macOS, and Windows Subsystem for Linux. It is installed once per user and activated per shell session. Typical usage shown in the README is short: nvm install 24 downloads and switches to Node 24, nvm use 22 switches to a previously installed version, and node -v confirms which is active. There is also a long-term-support helper, an offline-install option, a way to migrate global packages between versions while installing, and an .nvmrc file that lets a project record the version it expects so nvm picks it up automatically. People typically reach for nvm when one project needs an older Node and another needs the latest, when reproducing a bug that only appears on a specific version, or when configuring CI/CD images. The README walks through install scripts using curl or wget, manual and Docker-based installs, troubleshooting on Linux and macOS, shell-completion setup, and steps for uninstalling.

Copy-paste prompts

Prompt 1
How do I install nvm and use it to switch between Node.js 18 and Node.js 20 on my Mac?
Prompt 2
Show me how to set up an .nvmrc file so my team automatically uses the right Node version when they cd into our project.
Prompt 3
I need to test my app on Node 16, 18, and 20. How do I use nvm to install all three and switch between them?
Prompt 4
What's the easiest way to install nvm on Windows Subsystem for Linux, and how do I verify it's working?
Open on GitHub → Explain another repo

Generated 2026-05-18 · Model: sonnet-4-6 · Verify against the repo before relying on details.