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 supportedCommon 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
- Move Bun jobs to
ubuntu-latestormacos-latest. - Exclude Windows from the Bun matrix if you keep a cross-OS matrix.
- Use setup-bun on those runners as normal.
.github/workflows/ci.yml
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: oven-sh/setup-bun@v2Use 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
Bun "bun: command not found" in CIFix "bun: command not found" in CI - the runner has no Bun on PATH because setup-bun did not run, failed, or…
Bun "Segmentation fault" on the runner in CIFix Bun "Segmentation fault (core dumped)" in CI - a crash from an incompatible Bun build, an unsupported CPU…
Bun version mismatch (packageManager / bun --version) in CIFix Bun version mismatches in CI where the runner Bun differs from the one your lockfile or packageManager fi…