NVM allows you to install multiple versions of Node.js onto your machine, allowing you to switch between Node.js versions without actually reinstalling quickly.

Why do you need multiple versions of Node.js?

If you work with different types of apps, you may have specific dependencies. For example, I had to pull code for an SPFx web part to package and deploy it. The application’s dependencies required me to use a different version of Node.js than what I had installed.

Get NVM

Common Commands

  • nvm list available Get a list of available Node.js versions
  • nvm list Get a list of installed versions of Node.js
  • nvm install {version number} to install a new version
  • nvm uninstall {version number} to uninstall a version.
  • nvm use {version number} to switch to an installed version of Node.js

References

https://www.andrewconnell.com. 2017. “Andrew Connell - Better Node.Js Install Management with Node Version Manager.” Andrew Connell. April 26, 2017. https://andrewconnellpreview.z13.web.core.windows.net/blog/better-node-js-install-management-with-node-version-manager/.