Live
Embedding Vercel’s Zig Coding Agent: Architecture and Ops ImpactGemini 4 Argon trims ADK session prep and import latency by up to 40%Rethinking CI/CD: The Sensor Limits of an Agentic Software FactoryResolving the Kubernetes Autoscaling Conflict: Independent Controllers vs. Autonomous CoordinationAI‑Generated Queries Move Data Interface to Embedded DuckDB for Disaster‑Recovery AnalyticsIntegrating NVIDIA Earth-2 StormScope EU: Architecture, Ops, and Security TakeawaysData Agent Kit GA introduces open‑source skills and split guardrails for agent‑driven data accessTLS certificate authority eMudhra exits market after weak intermediate keys expose supply riskEmbedding Vercel’s Zig Coding Agent: Architecture and Ops ImpactGemini 4 Argon trims ADK session prep and import latency by up to 40%Rethinking CI/CD: The Sensor Limits of an Agentic Software FactoryResolving the Kubernetes Autoscaling Conflict: Independent Controllers vs. Autonomous CoordinationAI‑Generated Queries Move Data Interface to Embedded DuckDB for Disaster‑Recovery AnalyticsIntegrating NVIDIA Earth-2 StormScope EU: Architecture, Ops, and Security TakeawaysData Agent Kit GA introduces open‑source skills and split guardrails for agent‑driven data accessTLS certificate authority eMudhra exits market after weak intermediate keys expose supply risk
Cloudflare

Pin exact npm (or Yarn/pnpm/Bun) version in Cloudflare Workers Builds

AI SummaryPowered by AI

Workers Builds now reads a packageManager field in package.json to install a specific package manager version before dependency installation. This gives engineers deterministic builds and aligns CI behavior with local development.

Cloudflare Workers Builds now looks for a packageManager entry in your package.json and installs that exact npm (or Yarn, pnpm, Bun) version before running npm install. The change removes reliance on the default manager version and makes the build environment match the version that generated your lockfile.

Specifying the version

Insert a top‑level key in package.json with the full manager identifier. Use an exact version string; ranges are not supported.

{ "packageManager": "npm@11.19.1" }

Effect on build reproducibility

Because the manager version is fixed, a lockfile created with a newer npm will resolve dependencies the same way in the CI build as it does locally. This eliminates the classic "works locally but fails in CI" scenario caused by subtle differences in version‑specific resolution or peer‑dependency handling.

Operational and security considerations

  • Only the packageManager field influences the manager version; the engines.npm field is ignored.
  • Exact version pinning prevents accidental upgrades that could introduce breaking changes or unexpected behavior.
  • Since the manager is installed as part of the build image, there is no need to manage separate toolchain containers or custom images for version control.
  • Using a known manager version reduces the attack surface of supply‑chain tooling, as you can audit the specific binary that runs in the build environment.

Related CloudNinjas coverage: hands-on guides.

What This Means For Practitioners

Update your repository’s package.json with a packageManager entry matching the version you use locally. Verify the change in a test build, and incorporate the check into your CI pipeline to catch missing or mismatched entries early. Treat the field as the single source of truth for the package manager version across all Workers build workflows.

Originally published atCloudflare Developer Platform