Feature
Pin your npm version in Workers Builds with packageManager
You can now choose the npm version that Workers Builds uses by setting the packageManager field in your package.json. Before the build installs dependencies, it installs the npm version you set, so a lockfile written by a newer npm version installs the same way in your build as it does locally.
package.json
{ "packageManager": "npm@11.19.1" }
The packageManager field also sets the version of Yarn, pnpm, and Bun. Use an exact version, such as npm@11.19.1, not a range. Workers Builds does not use the engines.npm field to choose an npm version.
For more information, refer to Package manager versions.
Read the original announcement
Get Workers updates by email
Don't miss the next one: a weekly email with Workers's new features and deprecations.