Config File Locator

nvm config file locations


Commands use a POSIX shell (macOS, Linux, or WSL). Install the named editor or CLI first. Before using an environment-variable path, check that the variable is set to a non-empty, intended path. When using vi or Notepad, ensure the parent directory exists and is writable. A missing file is created when you save it; Notepad may ask to create it.

This page covers nvm-sh on macOS, Linux, and Windows through WSL using a POSIX shell. Native Windows nvm-windows is a separate product and is not covered. With no explicit version, nvm use searches upward from the current directory for the nearest .nvmrc; files are not merged. Creating .nvmrc alone does not switch Node.js versions: run nvm use. Automatic switching requires separate shell integration.

  1. Node.js version file

    Nearest file

    The nearest .nvmrc selects the version when no version is supplied to nvm use. Run commands from the project root or the ancestor directory whose .nvmrc you intend to edit.

    Config file location
    <project>/.nvmrc
    Contains one Node.js version or alias, such as lts/*, followed by a newline. Run nvm use from this directory or a descendant after editing. If that version is not installed, install it with nvm install.
    Commands
    vi "./.nvmrc"

Inspect configuration
nvm current

Official nvm documentation