Skip to content
Latchkey

Bun "This platform is not supported" (macOS/Linux only) in CI

Bun ships native builds for macOS and Linux. On a Windows runner without a Linux layer, setup-bun cannot install a usable binary, so the job fails before Bun runs.

What this error means

A job on windows-latest fails at the Bun setup or first bun call with a platform/unsupported error, while the same workflow passes on ubuntu-latest.

Terminal
Error: Unsupported platform: win32
# or, when a script pipe is used:
error: this platform is not supported

Common causes

A Windows runner without a Linux environment

Bun targets macOS and Linux; a bare windows-latest runner has no native Bun build to install.

A matrix that includes windows for Bun jobs

A cross-OS matrix runs the Bun job on Windows too, where it cannot run natively.

How to fix it

Run Bun jobs on Linux or macOS runners

  1. Move Bun jobs to ubuntu-latest or macos-latest.
  2. Exclude Windows from the Bun matrix if you keep a cross-OS matrix.
  3. Use setup-bun on those runners as normal.
.github/workflows/ci.yml
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: oven-sh/setup-bun@v2

Use WSL when Windows is required

If you must run on Windows, execute Bun inside a WSL/Linux context rather than the native Windows shell.

How to prevent it

  • Target Linux or macOS runners for Bun jobs.
  • Exclude windows from any Bun matrix leg.
  • Document that Bun native builds are macOS/Linux only.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →