nvm config file locations
Find nvm .nvmrc file locations and version-selection behavior on macOS, Linux, and WSL.
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.
Node.js version file
Nearest fileThe nearest .nvmrc selects the version when no version is supplied to nvm use. Replace <project> with the project root or an ancestor directory.
Config file location
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.<project>/.nvmrcCommands
vi "<project>/.nvmrc"
Inspect configuration
nvm currentOfficial nvm documentation