Running on Bun?

Bun refusing to install or run cleanly? We bring it back.

Bun is fast when it works, and genuinely strange when it does not. A package that installed under npm fails to postinstall, a Node API returns a slightly different shape, or a native addon refuses to load inside a Docker image built on the wrong base. We trace the gap between Node and Bun, and pick the smallest fix that keeps you productive.

  • Since 2015Fixing technology
  • FreeEstimates
  • US teamReal engineers

bun-install.log

still broken

What it is

Bun at a glance

Bun is a JavaScript runtime, package manager, bundler and test runner, released publicly by Jarred Sumner and Oven in 2022 and reaching version 1.0 in September 2023. Unlike Node and Deno, which build on Google's V8, Bun uses Apple's JavaScriptCore engine and is written largely in Zig, with a focus on raw startup time and throughput.

It implements a growing subset of Node compatibility: most of node:fs, node:path, node:crypto and node:http work out of the box, along with npm-style package resolution and a drop-in replacement for the npm, yarn and pnpm clients. Bun also ships its own HTTP server, SQLite binding, shell, test runner and build tool, which means a project can often run with no other tooling installed.

Type
JavaScript runtime, package manager, bundler and test runner
First released
2022 public beta, 1.0 in September 2023
License
MIT, open source
Maintained by
Oven, Inc.
Typically used for
Fast CI installs, local dev runtimes, API servers, scripts that would otherwise use tsx or ts-node, serverless cold-start optimisation

The honest version

Bun pros and cons

No technology is all upside. This is where Bun earns its place and where it tends to cause trouble.

Where Bun is strong

  • Package installs that feel instantbun install resolves and writes a typical project in under a second, often one to two orders of magnitude faster than npm or yarn, which changes the shape of CI.
  • TypeScript and JSX run nativelyNo separate ts-node, no tsx wrapper. Bun reads TypeScript sources directly, which removes an entire tier of tooling from most projects.
  • A built-in test runnerbun test is Jest-compatible enough for most suites, runs in parallel by default, and starts fast, so a watch mode actually feels responsive.
  • Bun.serve is a serious HTTP serverThe builtin server handily outpaces Express on simple benchmarks and gives you WebSockets, static files and TLS termination without a middleware layer.
  • One toolchain rather than fiveRuntime, package manager, bundler, test runner, shell and SQLite binding all come from the same binary, which cuts the yak-shave on new projects.
  • A credible path to lower infrastructure costFaster cold starts and smaller memory footprints move the budget on Lambda, Cloud Run and Fly workloads, often by a meaningful fraction.

Where Bun bites

  • Node compatibility is not completenode:vm, worker_threads edge cases, some streams behaviour and specific crypto algorithms are still partial, and the errors appear inside a dependency rather than in your own code.
  • Native addons are a minefieldModules that ship prebuilt binaries for Node often have no Bun build, and the fallback to node-gyp inside a slim Docker image blows up on missing toolchains.
  • Libraries assume Node at runtimePopular packages still check process.versions.node or ship runtime-specific code paths, so Bun hits the wrong branch and fails in ways that look like a bug in your code.
  • Observability tooling is thinAPM agents, OpenTelemetry auto-instrumentation and heap profiling tools still target Node first. Running Bun in production means giving up or building around that gap.
  • Memory handling can surprise youJavaScriptCore's garbage collector is different enough from V8 that long-running services sometimes retain memory or drop throughput in different patterns under load.
  • The ecosystem is youngDocumentation, Stack Overflow answers and hiring pool for Bun-specific issues are all smaller than Node's, so time to diagnose an unusual failure is longer on average.

Sound familiar?

Common Bun problems we fix

The Bun problems that bring people to us, and what you have once each one is fixed.

Failed to install sharp@0.33.2

A native dependency refuses to install

sharp, bcrypt, canvas and similar libraries ship Node-ABI prebuilds, and Bun needs either a compatible binary or a working toolchain inside the image to build from source.

Correct image, prebuild resolved

bun does not implement node:vm yet

A Node API is missing in Bun

A library reaches for node:vm, cluster or a specific crypto primitive that Bun has not shipped, and the call throws from deep inside a dependency tree.

Shim, swap, or stay on Node for that path

lockfile parse error

The lockfile will not read any more

A bun.lockb written on one version is being read by an older or newer one, or the lockfile was edited by a merge that bun did not resolve cleanly.

Lockfile regenerated, install deterministic

segmentation fault (thread 'bun')

Bun itself crashes on a specific input

A particular combination of flags, a FFI call, or an unusual file produces a hard crash in the runtime. Reproducing it is the first half of the fix.

Minimal repro filed, worked around

trustedDependencies not configured

Postinstall scripts refuse to run

Bun's security default blocks postinstall scripts unless the package is listed in trustedDependencies, which catches packages that legitimately need a build step.

Trusted list explicit, builds running

database disk image is malformed

bun:sqlite reports corruption under load

Concurrent writers against the same file without the right journal mode, or a WAL file left behind by a previous version, produce malformed-image errors.

Journal mode set, writes serialised

bcrypt prebuild missing for linux-x64-musl

Alpine images break native modules

A Dockerfile built on alpine or distroless musl has no glibc, and prebuilt binaries targeted at glibc refuse to load at startup.

Base image matched, binary loading

bun test coverage incompatible

CI expected Node and now gets Bun

A pipeline that assumed Node reporters, coverage format or specific CLI flags does not understand what bun test emits.

CI integration adjusted, coverage flowing

What we do

Bun help, from first run to production

Call us for one install that will not finish, or let us set Bun up across the organisation.

Rescue
A project that runs under Node but will not start on Bun. We find the exact incompatibility, pick the smallest workaround, and keep you moving.
Node to Bun evaluations
An honest assessment of whether your workload benefits from switching, with numbers on install time, cold start and memory before any commitment.
CI and Docker setup
Base images that work with native modules, lockfile strategy, cache configuration and parallel tests wired into GitHub Actions or your pipeline of choice.
Production hardening
Observability, process management, graceful shutdown and error reporting adapted to a Bun runtime, so incidents are not harder to triage than they would be on Node.
Hybrid setups
Running Bun where it wins and Node where it does not, inside the same monorepo, without the two tripping over each other.
Managed Tech
Monthly upkeep across runtime upgrades, dependency churn and the quiet compatibility regressions that still show up in a fast-moving project.

How it works

From first message to fixed

  1. Look Free estimate

    Tell us what's going wrong. We look at it, then tell you plainly what's wrong and what it will cost.

  2. Fix

    We fix the cause, not the symptom. If something is down, getting it back up comes first.

  3. Harden

    Backups, monitoring, updates and access, so the same problem can't quietly come back.

  4. Hand back or stay on

    You get a plain-language write-up. Or we stay on for hosting, upkeep and new work.

Often found together

Running Bun alongside something else?

We work on the whole stack, so the problem can be wherever it actually is.

Questions

Bun questions

Something else? Call+1 737 727 7327

Is Bun ready for production?

For many workloads, yes. API servers, scripts, CI pipelines and serverless functions run well on recent releases. Complex Node applications leaning on worker_threads, native addons or specific APM agents still need a careful compatibility check before the switch. We help you decide which bucket your service is in.

Why does a package that worked on Node fail on Bun?

Most of the time it is either a Node API Bun has not implemented yet, a native addon without a compatible prebuild, or a library that detects the runtime and takes a different code path. We identify which, pick the right workaround, and leave the rest of the project alone.

Can we use Bun just as a package manager and keep Node at runtime?

Yes, and this is the entry point for a lot of teams. bun install drops into any existing project and produces node_modules the same shape npm would, with a lockfile Bun can read later if you ever want to switch runtimes.

Will Bun actually make our CI faster?

In almost every project we have measured, yes, often by a wide margin. The install step collapses from tens of seconds to under one, and tests tend to run faster because the runner starts fast and parallelises by default. Savings compound on branches that run CI many times a day.

Can you migrate our Express or Fastify app to Bun.serve?

If you want to, yes, but it is rarely the first thing we recommend. Running Express or Fastify on top of Bun usually captures most of the performance win with far less rewrite. Moving to Bun.serve becomes worth it when the service is latency-sensitive enough to care about the final few milliseconds.

How much does Bun help cost?

A written quote costs nothing. Tell us which service you are moving and what has stopped working, and a price comes back the same day.

Free estimate

Bun not behaving in production?

Tell us what you're running and what's going wrong. A person reads it and comes back with an estimate.

  • No charge to find out what it will take
  • If it's urgent, say so

Replies come from a person. By sending, you authorize us to email you back. No marketing.