Installing multiple Node versions using NVM

NVM is a node version manager for Windows written in Go.

Here is a simple Step-by-Step guide for installing and using nvm.

STEP 1: Uninstall/ Delete existing node version

Make note of the current version of node you are using, if any, before deleting anything. Please note, you need to uninstall any existing versions of node.js before installing NVM for Windows. Also delete any existing nodejs installation directories (e.g., "C:\Program Files\nodejs") that might remain. NVM's generated symlink will not overwrite an existing (even empty) installation directory.

You should also delete the existing npm install location (e.g. "C:\Users\AppData\Roaming\npm") so that the nvm install location will be correctly used instead.

STEP 2: Download and Install NVM.

Download the latest installer from the releases https://github.com/coreybutler/nvm-windows/releases Download and extract the nvm-setup.zip file and run the installer.

Once installed you can check the version using command

nvm v

STEP 3: Use NVM to install node versions.

NVM for Windows is a command line tool. Simply type nvm in the console for help.

Reinstall the node versions you made note of before deleting or simply Install the latest version.

nvm install latest

This installs the latest version of node (at the point of writing, latest was 11.12.0 )

Additionally to install the node version 8.11.2.

nvm install 8.11.2

STEP 4: Switching between node versions. When you want to change the node version your currently using to another installed version, simply type

nvm use 8.11.2

When you run a 'nvm use x.x.x', the active version of node is automatically updated across all open console windows. It also persists between system reboots, so you only need to use nvm when you want to make a change.

Here is a useful Image

image

Other basic commands:

    nvm arch [32|64]

Show if node is running in 32 or 64 bit mode. Specify 32 or 64 to override the default architecture.

    nvm install <version> [arch]

The version can be a node.js version or "latest" for the latest stable version. Optionally specify whether to install the 32 or 64 bit version (defaults to system arch). Set [arch] to "all" to install 32 AND 64 bit versions.

   nvm list [available]

List the node.js installations. Type available at the end to show a list of versions available for download.

For nvm usage/manual installation/nvm project and more Details, refer: https://github.com/coreybutler/nvm-windows