Using Bun on Cloudflare Pages

As of September 2025, Cloudflare Pages doesn't natively support Bun as a package manager yet. When deploying a project that uses Bun, Cloudflare's build system defaults to npm1.

Thanks to this community thread, here’s my workaround based on their suggestion:

  1. Skip automatic dependency installation by setting the SKIP_DEPENDENCY_INSTALL environment variable to true in your Cloudflare Pages project settings:

    Environment variable configuration

    Set SKIP_DEPENDENCY_INSTALL=true environment variable
  2. Update build configuration to install manually install Bun during the build step by updating the Build command to:

    npm install -g bun && bun install && bun run build

    Build command setup

    Build command configuration

Footnotes

  1. When installing dependencies, the build log shows: “Installing project dependencies: npm install --progress=false”.