Skip to main content

Best way of installing Node.js using NVM

 NVM stands for Node Version Manager. Developers always need to work on multiple projects built on multiple node version. NVM helps us to manage multiple node version in a single machine. 

We have two steps:

1. Install nvm

2. Install node using nvm

1. Install nvm

$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh
$ source ~/.bashrc

This will install nvm in your machine.

2. Install node using nvm

First we need to check all the available node versions in nvm repository and then we will install

$ nvm list-remote
	   ...
       v14.17.3   (LTS: Fermium)
       v14.17.4   (LTS: Fermium)
       v14.17.5   (LTS: Fermium)
       v14.17.6   (LTS: Fermium)
       v14.18.0   (LTS: Fermium)
       v14.18.1   (LTS: Fermium)
       v14.18.2   (Latest LTS: Fermium)
        v15.0.0
        v15.0.1
        v15.1.0
        v15.2.0
        v15.2.1
        v15.3.0
        v15.4.0
        v15.5.0
        v15.5.1
        v15.6.0
        v15.7.0
        v15.8.0
        v15.9.0
       v15.10.0
       v15.11.0
       v15.12.0
       v15.13.0
       v15.14.0
        v16.0.0
        v16.1.0
        v16.2.0
        v16.3.0
        v16.4.0
        v16.4.1
        v16.4.2
        v16.5.0
        v16.6.0
        v16.6.1
        v16.6.2
        v16.7.0
        v16.8.0
        v16.9.0
        v16.9.1
       v16.10.0
       v16.11.0
       v16.11.1
       v16.12.0
       v16.13.0   (LTS: Gallium)
       v16.13.1   (Latest LTS: Gallium)
        v17.0.0
        v17.0.1
        v17.1.0
        v17.2.0
        v17.3.0

$ nvm install v16.13.1
$ nvm ls

 To use any specific version of node we can select certain node version.

$ nvm use v16.13.1

 We can change node version anytime. 

Comments