Cloudflare's Workers Builds image has preinstalled Nub since July 30, 2026. Package scripts that shell out to nub or nubx run unchanged:

{
  "scripts": {
    "build": "nub run i18n:compile && nubx vite build"
  }
}

There's no setup step to add and no devDependency to carry — the binary is on PATH the way pnpm and bun already are (tracking issue).

Workers Builds

Nub augments the Node the image provisions rather than bringing its own. Cloudflare's build image ships Node 22.23.2 and 24.18.0 and defaults to 24.18.0, so builds land on Nub's fast tier without configuration.

Both tools read the same version files, so a pin moves them together:

  • package.jsondevEngines.runtime
  • .node-version
  • .nvmrc
  • package.jsonengines.node

Set one and the build Node matches the version Nub resolves at runtime.

Cloudflare's support for .tool-versions is limited, and an entry it cannot resolve fails the build. Prefer .node-version or .nvmrc on Workers Builds.

Pages

The change landed in the Workers Builds image, not the Pages one. A Pages build still reports:

sh: nub: not found

Add @nubjs/nub as a devDependency there and call it from your scripts:

{
  "devDependencies": {
    "@nubjs/nub": "^0.6.0"
  },
  "scripts": {
    "build": "nubx vite build"
  }
}

The package declares bin: { nub, nubx }, so the install Cloudflare runs links both onto node_modules/.bin and your scripts resolve them. See Hosted builds for the full pattern.

Version pinning

The image carries one Nub version and moves it on Cloudflare's own cadence. To hold a project to a specific version instead, add @nubjs/nub as a devDependency as above — the same pattern Pages needs, and it works identically on Workers Builds.