0% found this document useful (0 votes)
7 views

Installing and Using NVM - Coding Ninjas

Uploaded by

afshithafi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Installing and Using NVM - Coding Ninjas

Uploaded by

afshithafi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Installing and Using NVM on Mac, Linux, and

Windows: A Step-by-Step Guide

Introduction

● Node Version Manager (NVM) is a useful tool that allows you to easily
manage multiple Node.js installations on your computer. With NVM, you can
quickly switch between different Node.js versions, install new ones, and
manage dependencies.

● In this document, we will guide you through the process of installing NVM on
Mac, Linux, and Windows operating systems. We will also cover some basic
NVM commands to help you get started.

Installing NVM on Mac


To install NVM on Mac, follow these steps:

1. Open a terminal window by pressing Command+Space, type Terminal, and


then press Enter.
2. Install Homebrew, a popular package manager for Mac, by running the
following command in the terminal: /bin/bash -c "$(curl -fsSL
https://raw.githubusercontent.com/Homebrew/install/HEAD/instal
l.sh)

3. Verify that Homebrew is installed correctly by running the following command:


brew –version

4. Use Homebrew to install NVM by running the following command in the


terminal:
brew install nvm
5. Configure NVM with the shell system by running the following command:
source $(brew --prefix nvm)/nvm.sh

6. Verify that NVM is installed correctly by running the following command:


nvm --version

Installing NVM on Linux


To install NVM on Linux, follow these steps:

1. Open a terminal window.

2. Install NVM by running the following command in the terminal: curl -o-
https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.s
h | bash

3. Close and reopen the terminal to reload the configuration files.

4. Verify that NVM is installed correctly by running the following command:


nvm --version

Installing NVM on Windows

NVM is mostly supported on Linux and Mac. It doesn't have support for Windows.
nvm-windows, however, is a comparable utility developed by coreybutler to offer a
nvm experience in Windows.

To install NVM on Windows, follow these steps:

1. Download and run the NVM Windows installer from the following GitHub
repository: https://github.com/coreybutler/nvm-windows/releases

2. Follow these instructions to complete the installation:


Use the link > Go to Assets > use nvm-setup.exe (install it) as shown in the
following image.
3. Open a new command prompt window.

4. Verify that NVM is installed correctly by running the following command:


nvm --version

Basic NVM Commands


Once you have installed NVM, you can use the following commands to manage your
Node.js installations:

● To list all the available Node.js versions:


nvm ls-remote

● To install a specific Node.js version:


nvm install <version>

● To switch to a different Node.js version:


nvm use <version>

● To set a default Node.js version to use in new shells:


nvm alias default <version>

You might also like