Install NVM (Node Version Manager)

nvm project logo

Do you ever find yourself needing to work with different versions of Node.js for different projects on the same computer? If so, you might want to check out a tool called NVM, which stands for Node Version Manager. With NVM, you can switch between different Node.js versions depending on what you need for your project.

To install or update nvm, you should run the install script. To do that, you may either download and run the script manually, or use the following cURL or Wget command:

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

To check that NVM has been installed correctly, run the following command:

nvm –version

If NVM has been installed correctly, you should see the version number displayed in your terminal.

For first time we can try to search the node version first, in this case we can type on our terminal:

1
nvm ls-remote

Or we can just type for the LTS version for much stable version

1
nvm ls-remote --lts

After that we can install the node version, for installing the node version we can type:

1
nvm install 16.19.0

Or we can type the release name, for this case on version 16.19.0 the release name are (Gallium)

1
nvm install Gallium

After the installation finish, try type :

1
node -v

To see the verion of installed nvm on your system

If you want to use the default version of node on your own, you can set the node by typing:

1
nvm alias default #Node Version (ex: 16.19.0) nvm install default 16.19.0

source: https://github.com/nvm-sh/nvm

As we know NVM are only on Linux and Mac OS, but after i done some search on internet i found another project like NVM but for windows

NVM For Windows : https://github.com/coreybutler/nvm-windows

To install it we can just download the binarry file (.EXE) from the release section in github Release : https://github.com/coreybutler/nvm-windows/releases/tag/1.1.10

As i know the NVM for windows version is still the same as the Linux version, you can read more about them in official github repo above