How to manage Node Version Using NVM

The Node Version Manager (NVM) is an open-source version control system for Node.js. NVM is simple to set up and use, and it works with any POSIX-compliant shell (for example, sh or bash). NVM makes it simple to install and switch between different versions of Node on a per-shell basis. This document explains how to set up NVM and how to use it to install and execute various Node versions.

It allows users to locally download any of the remote Long Term Support (LTS) versions of Node.js with a simple command. Its purpose is to easily switch between multiple versions of Node.js, right from the command line.

Installation

Run the NVM installer using either of the following commands:

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

Usage

If you don’t specify an exact version, nvm will download the latest version automatically. To isntall specific version of Nodejs use this command:

nvm install <version>

After installing any version of NodeJS with nvm you can easily switch to that version by running this command:

nvm use <version>


Reference

Leave a Comment

Your email address will not be published. Required fields are marked *