Set default node version with NVM

Set default node version with NVM

NVM or the Node version manager is a tiny command line application which enables you to efficiently manage multiple versions of node on your computer.

In this quick post, we’ll learn to set the default version of node using NVM.

To set the default node version use the following command. Make sure you replace 10.15.0 with your desired version.

nvm alias default 10.15.0

If you encounter an error similar to something as shown below, the version you’re trying to use might not be installed on your computer.

! WARNING: Version '10.15.0' does not exist.
default -> 10.15.0 (-> N/A)

Use the following command to install the missing node version and then try to set it as the default version.

nvm install 10.15.0

To make sure if NVM has set the desired node version as default use the following command.

node -v

If everything went well you’ll see the following output in your terminal window.

v10.15.0

Must Read: LocalStorage in JavaScript

Leave a Reply

Your email address will not be published. Required fields are marked *