Netlify Node version pinning: netlify.toml NODE_VERSION vs .nvmrc – which source wins?
0 reputation · 02 Aug 2023, 23:32 UTC
Goal: ensure the Node.js version used in Netlify production builds matches the version used locally to avoid build failures that work locally but fail in production.
Uncertainty: When both a NODE_VERSION variable set in netlify.toml under [build.environment] and a .nvmrc or .node-version file are present in the repository, Netlify documentation indicates the environment variable takes precedence, but the interaction with the selected build image and possible UI overrides can create ambiguity for teams deciding where to declare the version.
Which source does Netlify actually use when both are defined? Does the precedence change depending on the build image (e.g., Ubuntu Focal vs newer)? If a team prefers to keep version configuration in netlify.toml for centralized control, what risks arise from developers editing .nvmrc locally?