What is NVM?

Node Version Manager (NVM), is a tool for managing multiple Node versions on your machine.

For example, if you use a Node version of 10.0.0 for a project that uses 12.0.0, you may get some errors. And if you update the Node version to 12.0.0 with npm, and you use it for a project that uses 10.0.0, you may not get the expected experience.

Instead of using npm to install and uninstall Node versions for your different projects, you can use nvm, which helps you effectively manage your node versions for each project.

How to Install NVM on Windows

  1. Download NVM from the this link
  2. Install the .exe file of the latest release.
    Click on nvm-setup.exe installation file.

  3. Complete the installation wizard

NVM Commands

Install Node Version

$ nvm install       // Install a specific version
$ nvm install --lts               // Install the latest LTS release
$ nvm install-latest-npm          // Install latest NPM release only

List Available Releases

$ nvm ls-remote
$ nvm ls-remote | grep -i "latest"
$ nvm ls-remote | grep -i ""

List Installed Versions

$ nvm ls

Switch to a Version

$ nvm use <node_version_or_alias>  // Switch to a specific version
$ nvm use --lts                    // Switch to the latest LTS version

Verifying NodeJS Version

$ node -v
$ npm -v
$ nvm -v

Leave a Reply