How to nvm install

Content on WhatAnswers is provided "as is" for informational purposes. While we strive for accuracy, we make no guarantees. Content is AI-assisted and should not be used as professional advice.

Last updated: April 4, 2026

Quick Answer: To install Node Version Manager (nvm), you typically use a curl or wget command to download and execute an installation script from the official nvm GitHub repository. After running the script, you'll need to close and reopen your terminal or source your shell configuration file to start using nvm.

Key Facts

What is nvm?

Node Version Manager (nvm) is a powerful command-line tool that enables you to install, manage, and switch between different Node.js versions on your system. This is incredibly useful for developers who work on projects that may require specific Node.js versions or who want to test their applications with multiple Node.js environments.

Why Use nvm?

In the world of software development, dependencies are key. Different projects might rely on specific versions of Node.js to function correctly. Without a version manager like nvm, managing these different versions can become a cumbersome task involving manual installations and potential conflicts. nvm simplifies this process significantly, allowing you to:

How to Install nvm

The most common and recommended way to install nvm is by using an automated installation script provided by the nvm project on GitHub. This script handles downloading the latest version of nvm and setting up your environment correctly.

Prerequisites

Before you begin, ensure you have a Unix-like environment. nvm is designed for macOS, Linux, and Windows Subsystem for Linux (WSL). It does not natively support Windows Command Prompt or PowerShell directly, though workarounds exist (like using WSL).

Installation Steps

1. Open your terminal: Launch your preferred terminal application.

2. Download and run the installation script: You can use either `curl` or `wget` to fetch the script. The commands below are examples and you should always check the official nvm repository for the most current installation instructions and version numbers.

Using curl:

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

Using wget:

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

Note: Replace v0.39.7 with the latest stable version of nvm available on the official GitHub repository.

3. Verify the installation: The script will attempt to add the necessary nvm configuration lines to your shell profile file (e.g., ~/.bashrc, ~/.zshrc, ~/.profile). After the script finishes, you need to either close and reopen your terminal or explicitly source your profile file. For example, if you use Bash:

source ~/.bashrc

Or for Zsh:

source ~/.zshrc

4. Check nvm version: Once your terminal is reloaded, you can verify that nvm is installed and accessible by running:

nvm --version

If nvm is installed correctly, this command will output the installed nvm version number.

Troubleshooting Common Installation Issues

Getting Started with nvm

Once nvm is installed, you can start managing Node.js versions:

By following these steps, you can effectively install and begin using nvm to manage your Node.js development environments.

Sources

  1. nvm - Node Version ManagerMIT
  2. Node.js Release Schedulefair-use
  3. How To Install Node.js on Ubuntu 20.04 | DigitalOceanCC-BY-ND-4.0

Missing an answer?

Suggest a question and we'll generate an answer for it.