Skip to content

Instantly share code, notes, and snippets.

@sidvishnoi
Last active September 30, 2025 07:17
Show Gist options
  • Select an option

  • Save sidvishnoi/f795887659f5bec32f01a7ec9e788fc1 to your computer and use it in GitHub Desktop.

Select an option

Save sidvishnoi/f795887659f5bec32f01a7ec9e788fc1 to your computer and use it in GitHub Desktop.
Install and use specific Node.js version (respecting .nvmrc)

Projects use a .nvmrc file (or, sometimes .node-version file) to specify the required Node.js version, eliminating the need to manually pass it via the command line and remembering which version each project requires.

On Linux/MacOS

Install nvm

nvm install
nvm use

On Windows

The most popular alternative for nvm is nvm for Windows, but it doesn't support .nvmrc files, at least not ergonomically.

A comment by @jednano suggests following workarounds:

Powershell

nvm install $(Get-Content .nvmrc)
nvm use $(Get-Content .nvmrc)

Git Bash

cat .nvmrc | nvm install
cat .nvmrc | nvm use

General

You may prefer to use less-popular tools that support .nvmrc.

nvs is a cross-platform tool that works on Linux, MacOS as well as Windows.

nvs add
nvm use auto
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment