Skip to main content

nvm rc

Create or update a run-command file (for example, .nvmrc).

Usage

Usage: nvm rc [<version>] [flags]

Arguments

ArgumentRequiredDescription
[<version>]NoVersion specifier to resolve and write. If omitted, uses the current active version. Pinning file formats: Version Selectors.

Flags

FlagShortDescription
--file-fTarget file to write. Must be in configured auto_detect list.
--install-iInstall target version when missing.
--no-install-nDo not auto-install missing version for this command.

Examples

# write current active version to default detect file
nvm rc

# write explicit version to .nvmrc
nvm rc 24

# write to .node-version
nvm rc 22.14.0 --file=.node-version

# write package.json engines.node/npm
nvm rc 24 --file=package.json

# install if missing before writing
nvm rc 24 --install

# force no-install behavior for this command
nvm rc 24 --no-install

Sample output

Successfully set .nvmrc Node.js version to v24.1.0

Verified transcript (local run)

PS> nvm rc --help
Usage: nvm rc [<version>] [flags]

Flags:
-f, --file=.nvmrc
-i, --install
-n, --no-install

Behavior notes

  • For package.json, command updates engines.node and engines.npm.
  • For text detect files, command writes normalized Node.js version content.
  • If package.json does not exist in the current directory, the command fails.

This command pins project runtime intent for shim-mode auto-detection.