How to Install NVM on macOS, Windows, and Linux

February 6, 2026

Node Version Manager (NVM) is an essential tool for developers working with Node.js. It allows you to install, manage, and switch between multiple Node.js versions seamlessly across different projects. Whether you’re a beginner setting up your first development environment or an experienced developer handling multiple Node.js applications, NVM simplifies version control and boosts productivity.

In this guide, you’ll learn how to install NVM on macOS, Windows, and Linux, along with usage tips, troubleshooting advice, and best practices.

Introduction to NVM (Node Version Manager)

NVM manages Node.js versions per user in isolated directories. It supports project-specific versions via .nvmrc files and keeps global npm packages separate per Node version.

Why Use NVM (Node Version Manager) in 2026

Node.js follows a predictable release schedule:

  • Even-numbered versions become LTS (Long-Term Support).
  • Current LTS versions (February 2026):
    • Node 24 (Krypton) — Active LTS (entered May 2025; supported until ~April 2028).
    • Node 22 (Jod) — Maintenance LTS (until April 2026).
    • Node 20 (Iron) — Maintenance LTS (until April 2026).
  • Node 25 — Current (non-LTS; latest features as of January 2026).

NVM helps maintain legacy projects, test new features, and ensure team consistency.

NVM Implementations Overview

PlatformTool NameRepository LinkLatest Version (Feb 2026)Installation Type
macOS / Linux / WSLnvm-sh/nvmgithub.com/nvm-sh/nvmv0.40.4 (Jan 29, 2026)Shell script
Native Windowsnvm-windowsgithub.com/coreybutler/nvm-windows1.2.2 (Dec 31, 2024).exe installer

Use nvm-sh/nvm inside WSL on Windows for Unix-like behavior.

Prerequisites Before Installing NVM

Before installing NVM, ensure you have:

  • A terminal or command prompt
  • Basic command-line knowledge
  • Administrator or sudo access (for macOS and Linux)
  • PowerShell or Command Prompt access (for Windows)

No existing Node.js installation is required, but NVM can coexist with it if needed.

How to Install NVM on macOS

macOS users can install NVM using either curl or wget.

Step 1: Open Terminal

You can open Terminal from Applications → Utilities → Terminal or by using Spotlight Search.

Step 2: Install NVM Using curl

Run the following command:

curl -o-
https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash

Alternatively, using wget:

wget -qO-
https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash

Step 3: Load NVM

After installation, restart the terminal or run:

Step 4: Verify Installation

nvm --version

If a version number appears, NVM is installed successfully on macOS.

How to Install NVM on Linux

Installing NVM on Linux is similar to macOS and supports most distributions including Ubuntu, Debian, Fedora, and CentOS.

Step 1: Open Terminal

Use your default terminal application.

Step 2: Install NVM

Run the following command:

curl -o-
https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash

Step 3: Update Shell Configuration

Reload your shell configuration:

Step 4: Confirm Installation

nvm --version

NVM should now be available on your Linux system.

How to Install NVM on Windows

Windows uses a separate implementation called nvm-windows, which provides similar functionality.

Step 1: Download NVM for Windows

Visit the official GitHub repository for nvm-windows and download the latest installer.

Step 2: Run the Installer

  • Launch the .exe file
  • Follow the setup wizard
  • Choose installation and Node.js directories

Step 3: Restart Command Prompt or PowerShell

After installation, restart your terminal.

Step 4: Verify Installation

nvm version

You should see the installed NVM version displayed.

Installing Node.js Using NVM

Once NVM is installed, installing Node.js is straightforward.

Install the Latest Node.js Version

nvm install node

Install a Specific Node.js Version

nvm install 18.20.0

List Installed Versions

nvm ls

Switch Node.js Versions

nvm use 18.20.0

NVM automatically updates npm for each Node.js version.

Setting a Default Node.js Version

To set a default Node.js version:

nvm alias default 18.20.0

This ensures the selected version is used whenever a new terminal session starts.

Using NVM Per Project

You can create a .nvmrc file inside your project directory:

echo 18.20.0 > .nvmrc

Then run:

nvm use

This ensures consistency across teams and environments.

Common NVM Commands Cheat Sheet

CommandDescription
nvm install nodeInstall latest Node.js
nvm install <version>Install specific Node.js version
nvm use <version>Switch Node.js version
nvm lsList installed versions
nvm ls-remoteList available Node.js versions
nvm uninstall <version>Remove Node.js version

Troubleshooting Common NVM Issues

NVM Command Not Found

  • Ensure your shell configuration file is sourced
  • Restart the terminal

Permission Errors

  • Avoid using sudo with NVM
  • Ensure proper directory ownership

Windows Path Issues

  • Ensure no conflicting Node.js installations exist
  • Reboot system if needed

Best Practices When Using NVM

  • Use .nvmrc files for team consistency
  • Avoid global npm packages when possible
  • Keep Node.js LTS versions for production
  • Regularly update NVM
  • Test applications across multiple Node versions

Is NVM Suitable for Production Environments?

NVM is primarily designed for development environments. In production, containerization tools like Docker or managed Node.js environments are typically preferred. However, NVM remains invaluable for local development, testing, and CI pipelines.

Conclusion

Installing NVM on macOS, Windows, and Linux is a critical step for modern Node.js development. It provides flexibility, eliminates version conflicts, and streamlines project workflows. By mastering NVM, developers can focus more on building robust applications rather than managing environments.

For businesses looking to build scalable, high-performance Node.js applications, Carmatec stands out as a trusted Node.js development company. With deep expertise in enterprise-grade solutions, Carmatec helps organizations design, develop, and maintain powerful Node.js applications. Whether you want to modernize an existing system or hire Node.js developers for a new project, Carmatec delivers reliable, secure, and future-ready solutions.