.nvmrc

What is a .nvmrc file?

A single line of text containing the Node.js version this project expects — read by nvm, fnm, asdf, and Volta to switch versions on `cd`.

Safe format
Type Code
By nvm-sh contributors
MIME text/plain

Drop any file to identify it

No upload. No signup. No sending your file halfway across the internet.
We tell you what it is, right here in your browser.

What is it

The .nvmrc file is the smallest config file in any developer's repo: one line, containing one Node.js version number. Drop `20.11.0` (or `lts/iron`, or just `20`) into a file named .nvmrc at your project root, and any team member using nvm gets the right version with `nvm use`. Configure your shell to auto-switch when you `cd` into the directory and version mismatches across a team disappear entirely.

The syntax accepts whatever nvm understands as a version reference: a full version (`20.11.0`), a major version (`20`), an LTS codename (`lts/iron` for Node 20, `lts/hydrogen` for Node 18), or `node` for the latest. Most projects pin a major version to balance stability with the ability to pick up patch releases. Pinning a full version locks down the build environment exactly — useful for CI reproducibility.

Beyond nvm itself, .nvmrc is a de facto standard read by fnm, n, asdf (with the nodejs plugin), and Volta. CI providers like GitHub Actions support it directly via `actions/setup-node`'s `node-version-file: .nvmrc` input. The file is small enough that adding it to a project takes 10 seconds and saves the team hours of "works on my machine" debugging when someone is silently running Node 18 against code that expects Node 20.

Technical details
Full Name
.nvmrc
MIME Type
text/plain
Developer
nvm-sh contributors
Magic Bytes
N/A
Safety
.nvmrc is a known, safe format.
What opens it
Any text editor
FREE All
FAQ
What format does .nvmrc accept?
Any version reference nvm understands: `20.11.0` (full), `20` (major), `lts/iron` (codename), or `node` (latest). Most projects pin a full version for build reproducibility or a major version to allow patch updates.
Does Yarn or pnpm read .nvmrc?
Indirectly. .nvmrc is read by Node version managers (nvm, fnm, asdf, Volta), not by package managers. Once the version manager picks the right Node, all package managers running under it use that version. To enforce versions in package.json, use the `engines` field with `engine-strict=true` in .npmrc.
Related formats