How To Install NVM (Node Version Manager) on Ubuntu System?

Harish Kumar · · 23389 Views

This tutorial will assist you with installing NVM on the Ubuntu machine. Additionally, allow you to install different node versions and other useful examples.

NVM is a Node Version Manager tool. Using the NVM tool, you can install multiple node.js versions on a single system. You can likewise pick a particular Node version for applications. It also gives a choice to auto-select node version using the .nvmrc configuration file.

Installing NVM on Ubuntu

We will use curl to install NVM. So, make sure curl is installed on your system:

sudo apt install curl

Run the following command to install NVM, and make sure to replace v0.37.2 with the latest version of NVM.

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

 The script clones the nvm repository to ~/.nvm, and attempts to add the source lines from the snippet below to the correct profile file (~/.bash_profile~/.zshrc~/.profile, or ~/.bashrc).

export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm

Check the installed version, by running:

nvm --version

NVM commands

See  list all available node.js versions:

nvm ls-remote

Install latest LTS version of node:

nvm install --lts

Install a specific version of node:

nvm install 6.14.4 # or 10.10.0, 8.9.1, etc

See the list of installed node versions:

nvm ls

Switch to other installed node versions:

nvm use <your latest _working_ version from the ls>
0

Please login or create new account to add your comment.

0 comments
You may also like:

The Ultimate Guide to Mobile Game Development in 2023

Did you know that a game is a composition of all the modern aspects that are important for humans in today's world. It includes programming, art design, music, writing, and much (...)
Kenny William

How 2D Game Development Company is Helpful To Develop Excellent Mobile Games in 2023?

A reliable 2D game development company can be very helpful in developing outstanding mobile games because of their specialized expertise and experience in the domain. Here are (...)
Kenny William

Learn PHP Development from beginning.

PHP stance Hypertext Preprocessor, it's server-side scripting laungage and easy to use. PHP  also well  known for its speed, simplicity, flexibility features that have made it (...)
Programmer Desk

How to Create a Mobile App Using JavaScript: Step by Step Guide for 2023

How to Create a Mobile App Using JavaScript: Step by Step Guide for 2023
James Smith

Types of Instacart Clone Apps To Power Your Next Grocery Business

The Instacart app has been widely successful in delivering products on time. Not only are the items delivered safely, but they are also picked up by a specially assigned shopper. (...)
Narola Infotech

How to Upload Multiple Images with jQuery AJAX and PHP, with preview

Uploading an image without page refresh is more user-friendly than refreshing the entire page. So, in this guide, you will learn how to upload multiple images using ajax in jQuery (...)
Nakul Kumar