Skip to main content

Installing Node.js Using nvm

Installing Node.js on Windows using a Node Version Manager (nvm) is a good way to manage multiple versions of Node.js on the same machine. Here is how you can do it:

  1. Download and install the latest version of nvm for Windows from the official GitHub repository: https://github.com/coreybutler/nvm-windows

  2. After the installation is complete, open a Command Prompt window and run the command nvm list to verify that nvm has been installed successfully and to see the list of available Node.js versions.

  3. To install the latest version of Node.js, run the command nvm install latest. This will download and install the latest version of Node.js.

  4. To install a specific version of Node.js, run the command nvm install <version>, where <version> is the version number you want to install. For example, nvm install 12.16.3

  5. To switch to a different version of Node.js, run the command nvm use <version>, where <version> is the version number you want to switch to.

  6. To set a specific version of Node.js as the default version, run the command nvm alias default <version>, where <version> is the version number you want to set as the default.

  7. Verify that Node.js has been installed by running the command node -v to see the version of Node.js that is currently in use.

By using nvm you can install multiple version of node.js and easily switch between them according to the project you are working on without the need to uninstall the previous version, this way you can test your code with different versions of node.js and make sure it's compatible with different version and environments.