4Geeks chosen to deliver AI education in the Bahamas alongside Harvard, Oxford, and Columbia.See more

How to install NVM on Windows, macOS, and Linux

By 4Geeks

One guide for every system: install NVM, install Node.js 26 LTS and switch versions for each project.

7 min readLast updated
NVM icon

How do I install NVM?

Short answer: On macOS and Linux, run the official script curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.41.0/install.sh | bash, open a new terminal and run nvm install --lts. On Windows, nvm does not work: install NVM for Windows with winget install nvm-windows and run nvm install lts. Both install Node.js 26, the current LTS version, and let you switch versions with nvm use.

NVM (Node Version Manager) installs several versions of Node.js on the same computer and switches between them with one command. That way each project can use the version it needs, and you never have to uninstall Node.js to try another one.

There are two tools with almost the same name:

  • nvm (the nvm-sh project) for macOS, Linux and WSL. The latest version is 0.41.0, from November 4, 2026.
  • NVM for Windows, a separate project with similar commands. The latest version is 2.0.1, from October 2, 2026.

The same three steps on every system: install NVM, install Node.js LTS and switch versions with nvm use.

NVM at a glance

SystemToolInstall NVMInstall Node.js LTSStep-by-step guide
WindowsNVM for Windows 2.0.1winget install nvm-windowsnvm install ltsInstall NVM on Windows
macOSnvm 0.41.0Official install scriptnvm install --ltsInstall NVM on Mac
Linux and WSLnvm 0.41.0Official install scriptnvm install --ltsInstall NVM on Linux

Install NVM on Windows

  1. If you already have Node.js installed, uninstall it from Settings > Apps first. The NVM for Windows team recommends it to avoid conflicts.
  2. Open PowerShell and install NVM for Windows:
powershell
winget install nvm-windows

You can also download the installer, nvm-2.0.1-x64-setup.exe (or arm64 for ARM PCs), from the releases page and run it. Version 2 installs for your user, so you do not need an administrator terminal.

  1. Open a new terminal and install Node.js:
powershell
nvm install lts
nvm use lts
node -v

The full process, with upgrades from version 1 and the usual errors, is in how to install NVM on Windows.

Install NVM on macOS

  1. Open the Terminal and run the official script:
bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.41.0/install.sh | bash
  1. Close the Terminal and open a new one, then check it:
bash
command -v nvm

If it prints nvm, it worked. macOS uses zsh, and the script adds nvm to ~/.zshrc. If that file does not exist, the script cannot add it: create it with touch ~/.zshrc and run the script again.

The nvm team does not support installing nvm with Homebrew, so use the script. More details in how to install NVM on Mac.

Install NVM on Linux

  1. Make sure you have curl (on Ubuntu, sudo apt install curl), then run the script:
bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.41.0/install.sh | bash

If you prefer wget: wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.41.0/install.sh | bash.

  1. Load nvm in the current terminal, or open a new one:
bash
source ~/.bashrc
command -v nvm

The same steps work in WSL on Windows. The full guide, with Ubuntu, Debian, Fedora and the usual errors, is in how to install NVM on Linux.

Install Node.js and switch versions with NVM

The commands are almost the same on every system:

What you wantmacOS and Linux (nvm)Windows (NVM for Windows)
Install the LTS versionnvm install --ltsnvm install lts
Install a specific versionnvm install 24nvm install 24
Switch versionnvm use 24nvm use 24
Set the default versionnvm alias default 26nvm use 26 (it becomes the default)
List installed versionsnvm lsnvm list
Save the version in the projectnode -v > .nvmrcnvm pin
Uninstall a versionnvm uninstall 22nvm uninstall 22

Check the active version at any time with node -v and npm -v.

Which Node.js version should you install?

VersionStatus in November 2026Supported until
Node.js 26Active LTS, recommended for new projectsApril 2029
Node.js 24Maintenance LTSApril 2028
Node.js 22Maintenance LTSApril 2027
Node.js 20No longer supportedEnded April 2026

Node.js 27 is in testing and its stable release is planned for April 2027.

Career · AI Engineering for Developers

Node.js is ready, now build AI apps with it

Use the coding skills you already have to build AI agents, RAG systems and LLM-powered apps, with mentors and real projects.

Install and use NVM with AI

An AI assistant such as ChatGPT, Claude or GitHub Copilot can guide you through the setup and read the errors for you. Give it your system, your terminal and the exact text you see. These three prompts are ready to copy.

1. Get the exact steps for your computer

I use [Windows 11 with PowerShell / macOS 15 with zsh / Ubuntu 24.04 with bash].
I want to install NVM and Node.js 26 LTS, and keep Node 24 for an older project.
[I already have / I don't have] Node.js installed.
Give me the commands one by one, explain what each one does
and how to check that it worked.

2. Fix "nvm: command not found"

I installed nvm with the official script but my terminal says "nvm: command not found".
My system is [macOS 15 / Ubuntu 24.04] and my shell is [zsh / bash].
This is the output of: ls -a ~ | grep -E "bashrc|zshrc|profile"
[paste the output]
Tell me which file should load nvm and what lines it needs.

3. Move a project to a new Node.js version

My project runs on Node.js [20] and I want to move it to Node.js 26 LTS with nvm.
This is my package.json: [paste it]
Tell me how to install 26, which dependencies may break and how to save
the version in an .nvmrc file so my team uses the same one.

Read every command before you run it, especially the ones that change your shell profile or your PATH.

Use .nvmrc to fix the Node.js version of a project

An .nvmrc file in the root of a project says which Node.js version it needs. Anyone who clones it runs one command and gets the right version.

On macOS and Linux:

bash
node -v > .nvmrc
nvm use

nvm use with no version reads .nvmrc. If that version is not installed, nvm install installs it.

On Windows, NVM for Windows 2 writes the file for you with nvm pin, for example nvm pin 26.

Commit .nvmrc to your repository so the whole team works with the same version.

To install a new version and bring your global packages with you, use nvm install 26 --reinstall-packages-from=24 on macOS and Linux, or nvm install 26 --copy-from=24.22.2 on Windows, with the exact old version that nvm list shows.

Learn with a mentor

From managing versions to shipping AI features

In the 4Geeks AI Engineering for Developers program you add AI agents, RAG and production LLM apps to your portfolio.

Common errors when you install NVM

What you seeWhy it happensFix
nvm: command not found on macOS or LinuxThe terminal has not loaded nvm yet, or the script wrote to another profile fileOpen a new terminal or run source ~/.bashrc (or ~/.zshrc). On macOS, create ~/.zshrc with touch ~/.zshrc and run the script again
'nvm' is not recognized on WindowsThe terminal was opened before installingClose it and open a new one. If it persists, run the installer again
node -v shows a version that is not the one you choseA Node.js installed without NVM comes first in the PATHUninstall that Node.js from Settings > Apps on Windows, or remove it from your PATH on macOS and Linux
The version goes back to the old one in each new terminalNo default version is setRun nvm alias default 26 on macOS and Linux. On Windows, nvm use 26 already sets it
EACCES permission errors with npm install -gNode.js was installed with sudo or without NVMInstall Node.js with NVM and never use sudo with npm
curl: command not found on Linuxcurl is not installedRun sudo apt install curl on Ubuntu or sudo dnf install curl on Fedora
Free download

Every NVM command in a 2-page cheat sheet

How to install NVM on Windows, macOS and Linux, the everyday commands side by side, which Node.js version to pick, the most common errors and prompts for ChatGPT, Claude or Copilot. Free, in PDF.

NVM cheat sheet: Windows, macOS and Linux

2 pages · PDF · 4Geeks

  • The install commands for Windows, macOS, Linux and WSL
  • nvm and NVM for Windows commands side by side
  • The 5 most common errors and prompts to fix them with AI

Get it free

Your PDF right away

Frequently asked questions about installing NVM

Want to go from setting up Node.js to building AI apps, with real projects and mentors?

See the AI Engineering for Developers program