No Login Data Private Local Save

.nvmrc Node Version Generator - Online

11
0
0
0

.nvmrc Generator

Generate a .nvmrc file for Node Version Manager. Pick a version, copy or download — ready for your project.

v
Supports partial versions (20 → latest 20.x), full semver (20.11.0), and LTS codenames.
.nvmrc preview
lts/*
Copied!
echo "lts/*" > .nvmrc
Tip: Place .nvmrc in your project root, then run nvm use to switch automatically.

Frequently Asked Questions

What is a .nvmrc file?
A .nvmrc file is a plain text file that tells Node Version Manager (nvm) which Node.js version to use for a project. It contains a single line with a version string — like 20.11.0, lts/*, or lts/iron. When you run nvm use in that directory, nvm reads the file and switches to the specified version automatically. This ensures all developers on a team use the same Node.js version.
How do I use .nvmrc with nvm?
After creating your .nvmrc file (using this generator or manually), navigate to the project directory and run:

nvm use

If the version isn't installed yet, run:

nvm install

For automatic switching, add this to your shell profile (.bashrc, .zshrc):

cdnvm() { cd "$@" && if [ -f .nvmrc ]; then nvm use; fi; }
alias cd='cdnvm'

Or use tools like avn (Automatic Version Switching for Node) for seamless auto-detection.
What's the difference between lts/*, lts/iron, and a specific version number?
  • lts/* — Always resolves to the latest LTS release. Ideal for CI/CD pipelines or projects that want to stay on the newest LTS without manual updates.
  • lts/iron — Pins to a specific LTS codename (Iron = Node 20). This won't change even when a newer LTS is released.
  • 20.11.0 — Locks to an exact version. Use for strict reproducibility.
  • 20 — Partial version; nvm resolves to the latest patch within the 20.x range.
Can I use .nvmrc with other version managers like fnm or nodenv?
Yes! fnm (Fast Node Manager, written in Rust) fully supports .nvmrc files out of the box. nodenv uses .node-version instead, but the format is identical — a single version string. nvs and volta also respect .nvmrc or similar version files. This makes .nvmrc the most widely compatible choice for specifying Node.js versions across different tools.
How do I check if my .nvmrc is working correctly?
Run these commands in your project directory:

cat .nvmrc — Displays the file contents.
nvm use — Attempts to switch to the version specified.
node -v — Confirms the currently active Node.js version.

If nvm use says "Version not found," run nvm install first to download the required version.
What are all the Node.js LTS codenames?
Node.js LTS releases are given alphabetical codenames. Here's the full list:

CodenameVersionStatus
lts/jodv22Current
lts/ironv20Active LTS
lts/hydrogenv18Maintenance LTS
lts/galliumv16EOL
lts/fermiumv14EOL
lts/erbiumv12EOL
lts/dubniumv10EOL
lts/carbonv8EOL
lts/boronv6EOL
lts/argonv4EOL
Should I commit .nvmrc to version control (Git)?
Yes, absolutely. The .nvmrc file should be committed to your Git repository. This ensures every contributor uses the same Node.js version, preventing "works on my machine" issues. Add it alongside your package.json and other config files. It's a lightweight, framework-agnostic way to enforce Node version consistency across your team and CI/CD pipelines.