How to load the .nvmrc file under Windows

October 03, 2023

If you try to use nvm under Windows and load default version of node like (expected) :

nvm use

you will see :

A version argument is required but missing.

Reason seems to be that : .nvmrc is not supported (under Windows). More on this here : https://github.com/coreybutler/nvm-windows/issues/388#issuecomment-418513601

But what you still can do under PowerShell is :

nvm use $(Get-Content .nvmrc)

and you are good to go.

(Stolen from https://gist.github.com/danpetitt/e87dabb707079e1bfaf797d0f5f798f2)

Hope you saved some time.


Profile picture

Written by Dušan Roštár - the "mr edge case" guy
my twitter : rostacik, my linkedin : rostar, drop me an email : here