How to switch Node.js versions with NVS

Easy Way to Install Multiple Versions of Node JS with NVS

--

Node version switcher is a tool that allows you to manage multiple versions of Node.js on your system and switch between them as needed. It is particularly useful when working on projects that require different versions of Node.js due to compatibility or specific requirements. or if you need to test a project with a newer version of Node.

There are several popular version switchers available for Node.js, including:

  1. NVM (Node Version Manager): NVM is a widely used version manager for Node.js. It allows you to install and manage multiple versions of Node.js on your system. You can easily switch between installed versions using simple commands in the terminal. NVM is available for Unix-based systems (such as macOS and Linux).
  2. NVM for Windows: NVM for Windows is a version manager specifically designed for Windows systems. It provides similar functionality to NVM, allowing you to install and switch between different Node.js versions on your Windows machine.
  3. N: N is a version manager for Node.js built on top of NVM. It provides a simpler command-line interface and focuses on ease of use. N also supports installing and switching between multiple Node.js versions.

These version switchers typically work by installing different versions of Node.js in separate directories and updating the system’s PATH environment variable to point to the desired version. This allows you to switch between versions seamlessly without conflicts.

NVM vs NVS:

NVS is a cross-platform versatile tool designed to facilitate the management of various Node.js versions and forks. It is implemented using node JavaScript and draws inspiration from other popular node version managers, particularly nvm, incorporating similar command-line syntax and concepts.

Unlike NVM, which may entail permissions or authorization hurdles when changing Node.js versions, NVS provides a seamless experience with no such restrictions. You can effortlessly switch between Node.js versions without encountering any authorization processes or limitations.

NVS also offers support for convenient switching between different node forks, such as node-chakracore. Additionally, being written in node JavaScript, it encourages node developers to actively contribute and participate in its development.

NVS Installation Process

To install NVS, We need to follow some steps :

Image by Author
  • Install the NVS file.
  • Now Open Command Prompt and Type “nvs”
Image by Author
  • You will see your current node version as the output, Now you have to select ‘Download another version’
Image by Author
  • From the node versions list we can select the desired node version by using the Down/Up arrows and press the enter button
  • The selected node version will start downloading…
Image by Author
  • Now check the Node Version using node -v
Image by Author
  • Now we have successfully changed the node version to our desired node version

Command reference

Image by Author

Reference URLs :

  1. https://github.com/jasongin/nvs
  2. https://github.com/jasongin/nvs/releases
  3. https://github.com/nvm-sh/nvm

If you have reached this far, thank you for reading this blog, I hope you found it insightful 😃. Give us a follow for more content on technology, productivity, work habits, and more!

--

--