oven-sh/bun · error · Error

not 200

Error message

not 200

What it means

Raised while saving/rebuilding the lockfile: `old.root_package()` returned None (src/install/lockfile.rs:968), meaning the loaded lockfile's package list has no root workspace package, so the 'recreate with only alive packages' step cannot proceed.

Solutions

  1. Delete bun.lockb (and bun.lock if present) and run `bun install` to regenerate from package.json
  2. If it recurs, upgrade Bun - a save-path bug or crashed save could produce it
  3. Ensure no git filters/LFS or scripts rewrite bun.lockb

Example fix

# before: keep the damaged lockfile and retry
$ bun install

# after
$ rm bun.lockb bun.lock 2>/dev/null; bun install
Defensive patterns

Strategy: fallback

Try / catch

const code = Bun.spawnSync(["bun", "install"]).exitCode;
if (code !== 0) {
  await Bun.$`rm -f bun.lockb bun.lock`;
  await Bun.$`bun install`;
}

Prevention

When it happens

Trigger: A bun.lockb/bun.lock whose root package entry (the workspace root at index 0) is missing - typically a hand-edited or binary-merge-mangled lockfile, or one produced by a crashed/aborted earlier install save.

Common situations: Resolving merge conflicts directly inside bun.lockb; external tooling rewriting the lockfile; checking out a branch whose lockfile was written by an interrupted install.

Related errors


AI-assisted analysis of oven-sh/bun@8c5296ac45 (2026-08-16). Data as JSON: /api/errors/92bb22f9029f826f. Report an issue: GitHub.

Appendix: source

Thrown at bench/emitter/realworld_stream.mjs:35

  const randomUnder1 = nextInt() / 0x7fffffff; // 2**31 - 1
  return start + Math.floor(randomUnder1 * rangeSize);
}

const chunks = new Array(1024).fill(null).map((_, j) => {
  const arr = new Uint8Array(1024);
  for (let i = 0; i < arr.length; i++) {
    arr[i] = nextRange(0, 256);
  }
  return arr;
});

groupForEmitter("stream simulation", ({ EventEmitter, name }) => {
  bench(name, () => {
    let id = 0;
    const stream = new EventEmitter();

    stream.on("start", res => {
      if (res.status !== 200) throw new Error("not 200");
    });

    const recived = [];
    stream.on("data", req => {
      recived.push(req);
    });

    stream.on("end", ev => {
      ev.preventDefault();
    });

    // simulate a stream
    stream.emit("start", { status: 200 });
    for (let chunk of chunks) {
      stream.emit("data", chunk);
    }
    stream.emit("end", {
      preventDefault() {

View on GitHub (pinned to 8c5296ac45)