Cloudflare Workers Builds can now pin your exact npm version
A new packageManager field in package.json stops cloud builds silently installing a different npm, Yarn, pnpm or Bun version than the one you use locally.
Cloudflare Workers Builds now reads a packageManager field in package.json and installs that exact version before running your build, rather than whatever version its build image ships with by default.
The field takes an exact version, not a range, and works across npm, Yarn, pnpm and Bun:
{
"packageManager": "npm@11.19.1"
}
Cloudflare says the existing engines.npm field is not used for this, since it was only ever a hint rather than an enforced version.
Why it matters: a mismatched package manager version between your laptop and the build runner is a classic source of lockfile drift, builds that pass locally but fail in CI, or dependency trees that quietly differ between the two. Pinning the version removes that gap for anyone deploying through Workers Builds.