nvm/README.md
2025-04-15 19:09:33 +05:30

4.0 KiB

nvm project logo

Node Version Manager (NVM)

Build Status nvm version CII Best Practices


Node Version Manager (NVM) is a versatile tool that empowers developers to manage multiple Node.js versions effortlessly. With NVM, switching between Node.js versions becomes seamless, ensuring compatibility and flexibility for diverse projects.


Table of Contents


Introduction

NVM simplifies the process of managing Node.js versions, making it an indispensable tool for developers working on varied projects. With just a few commands, you can install, switch, and manage Node.js versions effortlessly.

Example Usage:

nvm use 16
# Now using node v16.9.1 (npm v7.21.1)
node -v
# v16.9.1
nvm use 14
# Now using node v14.18.0 (npm v6.14.15)
node -v
# v14.18.0
nvm install 12
# Now using node v12.22.6 (npm v6.14.5)
node -v
# v12.22.6

About NVM

NVM is a version manager for Node.js, designed to be installed per-user and invoked per-shell. It works on any POSIX-compliant shell (sh, dash, ksh, zsh, bash) and supports platforms like Unix, macOS, and Windows WSL.


Installation and Updates

Install & Update Script

To install or update NVM, run the following script using either curl or wget:

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

This script clones the NVM repository to ~/.nvm and updates your shell profile to load NVM automatically. If the script updates the wrong profile file, set the $PROFILE environment variable to the correct file path and rerun the script.


For more details, refer to the full documentation.