Skip to content
Skip to content
Menu
A cup of dev
  • Home
  • About
  • Ink and yarn
  • Contact
A cup of dev

How to use node version manager (nvm for windows) to handle different node-versions

By Eli H. Schei on Saturday, 12 June 2021, 17:00Thursday, 19 August 2021, 4:53

Disclaimer: This is about nvm for windows. If you are on mac/linux follow this link to find the correct version.

Have you ever experienced difficulties with a project because you are on the wrong node version? I have! A lot of projects break, or won’t build, if you don’t have the required version. Previously I used to uninstall/install the correct version manually. And it was a pain everytime. And what if you are working on multiple projects that all uses different node versions? This is where NVM comes in handy.

With nvm you can have multiple versions of node installed at the same time, and easily switch between them! In this blogpost I will show you how to install and use nvm.

Installing nvm for windows

Go to nvm-windows github repo and download the zip-file containing the installation wizard.

Run the installation wizard, click next a bunch of times, and then wait while it installes on your computer.

When its finished open your CLI (command line interface). I use windows terminal, but regular command prompt (or any other) will do to. If nvm installed correctly you can now run nvm version and get the version number in return.

nvm version

Using nvm

Install versions of node
Now you can start installing different node versions. You do this by running nvm install and the version number you would like to install. So if you want to install node version 10.23.2, you would run the following command

nvm install 10.23.2

See the versions you have installed
To see what versions you have already installed simply run nvm list

shows how to use nvm for windows to list all installed node versions

In the above picture you can see that I have installed seven different versions of node, and I’m currently using 10.23.2.

Switch between versions
To switch version run nvm use followed by the version number

nvm use 12.21.0

And thats it! You can now switch between different versions.

Worth noticing

Its written so well in the documentation so I will simply quote it here:

Please note that any global npm modules you may have installed are not shared between the various versions of node.js you have installed. Additionally, some npm modules may not be supported in the version of node you’re using, so be aware of your environment as you work.


Did you find this article usefull? Follow me on twitter to be notified when I publish something new!

Also, if you have any feedback or questions, please let me know in the comments below. šŸ™‚

Thank you for reading, and happy coding!

/Eli

Share this:

  • Twitter
  • Facebook

Post navigation

A beginners guide to web accessibility for developers. Part two: 5 principles you should start implementing right away
A beginners guide to web accessibility for developers. Part 3: A look at some more complex challenges

3 thoughts on “How to use node version manager (nvm for windows) to handle different node-versions”

  1. Pingback: 5 must have extensions when working with SharePoint Framework (SPfx) - A cup of dev
  2. Pingback: 5 must have extensions to work with SharePoint framework (SPfx)
  3. Pingback: A collection of resources for Microsoft 365 developers - A cup of dev

Leave a Reply Cancel reply

Eli H. Schei

I'm a front-end developer who mainly work in the Microsoft 365-sphere. As a developer I read a lot of blogs. And in my experience I can read multiple different blogposts about exactly the same topic, and only one of them makes sense to me. Therefore I’m adding my voice to the mix, and hopefully one of my blogposts will be the one that makes sense of a topic for you. You can learn more about me here.

Recent Posts

  • How to solve CORS issues when running an Azure function locally
  • An introduction to version control using git and GitHub
  • 5 tips for nailing your first Microsoft certification exam
  • My top 5 most read blogposts in 2022
  • How to solve the ‘Could not find the task func: host start’ error in VS Code when working with Azure functions

Categories

  • Azure
    • Azure functions
  • Level
    • Beginner
    • Intermediate
  • Microsoft 365 Development
    • Microsoft Authentication Library
    • Microsoft Graph
    • Microsoft Teams
    • PNP powershell
    • PowerApps
      • PowerApps Component Framework
    • SharePoint Framework
    • SharePoint Online
  • Web development
    • Accessibility
    • Soft skills
    • Tips and tricks

Tags

accessibility ARIA azure Azure CLI azure functions Content creation custom themes favorites git github M365 CLI M365 development PCF PnP powershell power apps PowerApps Component Framework quicktip react resources SharePoint Online Sideloading SPfx Teams tools wcag Windows terminal
©2023 A cup of dev | WordPress Theme by SuperbThemes.com