Build Image Runtimes, Version Overrides, and Update Policies
How Cloudflare Pages and Workers Builds choose Node.js, Python, and other tools; pin versions; migrate build systems; and handle rolling image updates.
This page summarises Cloudflare documentation for the build image used by Cloudflare Pages and Workers Builds. Both products run your clone-and-build steps inside a preconfigured Linux container with many languages and CLI tools already installed. Defaults change over time; the same mechanisms let you pin a runtime when a deploy must stay predictable.
Build image: what runs your CI build command
Section titled “Build image: what runs your CI build command”The build image is the environment that executes your build command after Cloudflare checks out your repository. Pages and Workers Builds share the same broad idea—broad language support with defaults you can override—but they use different base OS versions and different dashboard locations for variables.
Cloudflare Pages’ build environment has broad support for a variety of languages, such as Ruby, Node.js, Python, PHP, and Go.
— Cloudflare, Build image (Pages)
Workers Builds uses a build image with support for a variety of languages and tools such as Node.js, Python, PHP, Ruby, and Go.
— Cloudflare, Build image (Workers Builds)
Pages builds run in a gVisor container on Ubuntu 22.04 (x86_64) on the current v3 build system. Workers Builds run on Ubuntu 24.04 (x86_64). Exact preinstalled package versions are listed in each product’s build image table and are updated under the policies below—treat the dashboard docs as the source of truth, not a single frozen snapshot.
NODE_VERSION and version files: how to pin Node.js, Python, and other runtimes
Section titled “NODE_VERSION and version files: how to pin Node.js, Python, and other runtimes”If you need a specific language version, you set an environment variable in the project build settings, add a version file at the repository root, or (for some package managers on Workers) use package.json.
If you need to use a specific version of a language, (for example, Node.js or Ruby) you can specify it by providing an associated environment variable in your build configuration, or setting the relevant file in your source code.
— Cloudflare, Build image (Pages)
Common overrides include NODE_VERSION with .nvmrc or .node-version, PYTHON_VERSION with .python-version or runtime.txt, RUBY_VERSION with .ruby-version, GO_VERSION, BUN_VERSION, HUGO_VERSION, YARN_VERSION, and PNPM_VERSION. On Pages v3, under Supported versions, “Any version” means you may request versions newer than the listed default, not only older ones—see the languages and runtime tables.
Where to set environment variables
Section titled “Where to set environment variables”| Product | Dashboard path | Also via |
|---|---|---|
| Cloudflare Pages | Settings → Environment variables | Wrangler |
| Workers Builds | Settings → Build → Build Variables and Secrets | Build variables in CI |
For a file-based override, place the file in the project root with only the version number as content—for example .node-version containing 22.
Or, to set the version by adding a file to your project, you can: Find the file name for the language or tool in this table. Add the specified file name to the root directory of your project, and add the desired version number as the contents of the file.
— Cloudflare, Override default versions (Pages)
Framework versions in package.json
Section titled “Framework versions in package.json”Framework versions (Gatsby, Next.js, and similar) are not separate image knobs: declare them in package.json dependencies. During the build, Cloudflare installs that version with your package manager unless it is already cached.
To use a specific version of a framework, specify it in the project’s package manager configuration file.
— Cloudflare, Frameworks (Pages build image)
packageManager field: npm, Yarn, pnpm, and Bun on Workers Builds
Section titled “packageManager field: npm, Yarn, pnpm, and Bun on Workers Builds”On Workers Builds, the packageManager field in root package.json is how you pin npm (and also Yarn, pnpm, or Bun). Pages v3 does not use packageManager for npm the same way; it relies on env vars and lockfile-oriented defaults described in the Pages build image.
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.
— Cloudflare, Pin your npm version in Workers Builds with packageManager
{ "packageManager": "npm@11.19.1"}Workers Builds reads packageManager from the root package.json, and also from a top-level repo package.json when the Worker’s root directory is nested. Use an exact version (npm@11.19.1), not a range. If parsing fails, the build falls back to the image default.
The engines.npm field in package.json does not set the npm version. If you only set engines.npm, Workers Builds uses the default npm version, and npm prints an EBADENGINE warning instead of failing.
— Cloudflare, Package manager versions (Workers Builds)
That matches a common failure mode in Troubleshooting builds: npm ci succeeds locally but fails in CI because the lockfile was produced by a newer npm than the image default. Set packageManager to your local npm -v output.
On Workers, packageManager can also set Bun, Yarn, and pnpm via the same field; Bun additionally documents the packageManager field in the Workers tooling table.
Pages v3 build system: migration, limits, and SKIP_DEPENDENCY_INSTALL
Section titled “Pages v3 build system: migration, limits, and SKIP_DEPENDENCY_INSTALL”The v3 Pages build system updates default tools and languages toward current LTS lines. New Pages projects use v3 by default; existing projects can switch under Settings → Build & deployments → Build system version, as described in Cloudflare Pages builds now provide Node.js v22 by default.
The v3 build system updates the default tools, libraries and languages to their LTS versions, as of May 2025.
— Cloudflare, v3 build system (Pages)
When you migrate from v1 or v2, a build that implicitly relied on old defaults may fail until you pin versions.
If you were previously relying on the default versions of any languages or tools in the build system, your build may fail when migrating to v3. To fix this, you must specify the version you wish to use by overriding the default versions.
— Cloudflare, v2 to v3 Migration (Pages)
v3 limitations that break some Pages workflows
Section titled “v3 limitations that break some Pages workflows”On v3 you cannot rely on:
- Node.js version codenames (for example
hydrogenorlts/hydrogen) - Inferring Yarn from
yarn.lockor pnpm frompnpm-lock.yaml package.json→enginesfor Node or package managers- Pipenv /
Pipfilesupport
List taken from Limitations (Pages v3).
To run your own install step instead of the automatic dependency install, set:
| Build variable | Value |
|---|---|
SKIP_DEPENDENCY_INSTALL |
1 or true |
This applies to both Pages and Workers Builds.
Build image deprecation (Pages): v1 and v2 automatic move to v3
Section titled “Build image deprecation (Pages): v1 and v2 automatic move to v3”Only Pages has numbered build image generations (v1, v2, v3). v1 and v2 projects are scheduled to move to v3 automatically:
- v1 → v3 on September 15, 2026
- v2 → v3 on February 23, 2027
Cloudflare promises six months’ notice via Changelog, dashboard notifications, and email. After v3, there are no further build image version changes—only rolling updates to preinstalled software (Build Image Version Deprecation).
Workers Builds does not use v1/v2/v3 labels; it follows the same rolling default policy described next.
Rolling updates: minor bumps, LTS majors, and how to stay stable
Section titled “Rolling updates: minor bumps, LTS majors, and how to stay stable”Published policies for both products appear in Build image policies for Workers Builds and Cloudflare Pages and the build image docs.
| Change type | Notice | Applies when |
|---|---|---|
| Minor version of preinstalled software | Often none | You use the image default (no override) |
| Tools without strict semver (e.g. Bun, Hugo) | 3 months when updates may break | Default not overridden |
| Major / next LTS before EOL | 3 months | Default not overridden |
| Pages v1/v2 image deprecation | 6 months | Pages only |
Preinstalled software (languages and tools) will be updated before reaching end-of-life (EOL). These updates apply only if you have not overridden the default version.
— Cloudflare, Preinstalled Software Updates (Pages)
Workers Builds states that defaults move to the latest minor regularly, and major bumps come with notice; pin a minor if you need stability (Supported Tooling).
Changelog entries such as Workers Builds now uses newer versions of Node.js, Python, Go, Bun, and more illustrate rolling forward—if you depended on a previous default, add e.g. PYTHON_VERSION=3.13.3 rather than assuming the old default forever.
Recommended practice from both docs:
Pin specific versions of critical preinstalled software by overriding default versions
— Cloudflare, Best Practices (Pages build image)
The Pages platform changelog also urged pinning modern Node.js when v2 still defaulted to Node.js 18 approaching EOL—same underlying lesson: defaults follow platform policy, not how long the codebase has been on the platform.
Trusted CA certificates during builds and the eMudhra incident
Section titled “Trusted CA certificates during builds and the eMudhra incident”Build steps use the system bundle at /etc/ssl/certs/ca-certificates.crt. Cloudflare sets variables so runtimes with bundled CAs trust the same store, including when you select an older runtime via overrides:
| Variable | Value |
|---|---|
SSL_CERT_FILE |
/etc/ssl/certs/ca-certificates.crt |
PIP_CERT |
/etc/ssl/certs/ca-certificates.crt |
REQUESTS_CA_BUNDLE |
/etc/ssl/certs/ca-certificates.crt |
NODE_OPTIONS |
includes --use-openssl-ca |
Details: Trusted certificates (Pages) and Trusted certificates (Workers Builds). Project-level values replace defaults; --use-openssl-ca is merged into your NODE_OPTIONS unless you already set --use-openssl-ca or --use-bundled-ca.
Build images were patched to reject compromised eMudhra intermediates during clone, install, and HTTPS from the build:
The Workers Builds and Pages build images now reject these certificates when your build clones your repository, installs dependencies, or makes HTTPS requests.
— Cloudflare, Workers Builds and Pages build images reject compromised eMudhra certificates
Most projects need no change. Review your setup if you pin BUN_VERSION below 1.4.4, override SSL_CERT_FILE / PIP_CERT / REQUESTS_CA_BUNDLE or use --use-bundled-ca in NODE_OPTIONS, or install tools that ship their own CA store (What you need to do).
Common build-image mistakes
Section titled “Common build-image mistakes”- Assuming
engines.nodeorengines.npmpins the image on Pages v3 or Workers Builds—they do not; useNODE_VERSION/ files orpackageManager(Workers npm) per Limitations (Pages) and Package manager versions. - Migrating Pages to v3 without pins when the project never declared versions—expect failures until you override (v2 to v3 Migration).
- Lockfile/npm drift on Workers—fix with exact
packageManager(Troubleshooting builds). - Overriding CA env vars with a custom bundle that still trusts compromised intermediates after the image update (build images eMudhra changelog).
- Relying on default minors for reproducible releases—override versions on anything business-critical (build image policies).
How to check this on your site
Section titled “How to check this on your site”-
Open the official build image doc for your product—Pages or Workers Builds—and note the default versions for tools your pipeline uses.
-
In the Cloudflare dashboard, confirm Environment variables (Pages) or Build Variables and Secrets (Workers) match the pins you expect (
NODE_VERSION,HUGO_VERSION, etc.), including Preview for Pages if you use previews. -
Trigger a build and read the install log: verify the reported Node/npm/Python versions and that
npm cior your package manager runs without engine/sync errors (Troubleshooting builds). -
Subscribe to Cloudflare Changelog (and Pages platform changelog if you use Pages) for build image and default-version announcements.
-
You can check automatically in Answerwell (our tool): https://answerwell.org/workspace
Report an error or ask a question
Section titled “Report an error or ask a question”If something on this page is wrong or unclear, email yimasynthetic@gmail.com with the page URL and the exact statement you are asking about, and we will correct or clarify it.