diff --git a/docs/lang/node.md b/docs/lang/node.md index 11621f4e79..b3887aadd8 100644 --- a/docs/lang/node.md +++ b/docs/lang/node.md @@ -49,14 +49,30 @@ npm = "11.12.1" The pinned npm version takes precedence over the one bundled with Node, so `npm --version` will always return the version specified in `mise.toml`. -## `.nvmrc` and `.node-version` support +## `.nvmrc`, `.node-version` and `package.json` support By default, mise uses a `mise.toml` file for auto-switching between software versions. -It also supports `.tool-versions`, `.nvmrc` or `.node-version` file to find out what version of Node.js should be used. This will be used if `node` isn't defined in `mise.toml`. +It also supports `.tool-versions` file to specify versions for ASDF compatibility. Additionally, `.nvmrc`, `.node-version`, and the `devEngines` field in `package.json` are supported but require explicit enabling (see tip below). This makes it a drop-in replacement for `nvm`. See [idiomatic version files](/configuration.html#idiomatic-version-files) for more information. +::: tip +Idiomatic version files (`.nvmrc`, `.node-version`, `devEngines` field in `package.json`) are disabled by default and must be explicitly enabled: + +```sh +mise settings add idiomatic_version_file_enable_tools node +``` + +Or in `~/.config/mise/config.toml`: + +```toml +[settings] +idiomatic_version_file_enable_tools = ["node"] +``` + +::: + ## Default node packages mise-node can automatically install a default set of npm packages right after installing a node version. To enable this feature, provide a `$HOME/.default-npm-packages` file that lists one package per line, for example: