oven-sh/bun · error · Error
not implemented right
Error message
not implemented right
What it means
Generic write/IO failure in install-related code. Notably every `std::io::Error` inside the install crate converts to this variant (From impl at src/install/error.rs:420-424), and commands that emit JSON map write errors to it (e.g. src/runtime/cli/pm_pkg_command.rs:229). Printing a lockfile treats WriteFailed/BrokenPipe as benign (src/install/lockfile.rs:1646).
Source
Thrown at bench/emitter/realworld_stream.mjs:58
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() {
id++;
},
});
if (id !== 1) throw new Error("not implemented right");
if (recived.length !== 1024) throw new Error("not implemented right");
});
});
await run();
View on GitHub (pinned to 8c5296ac45)
Solutions
- Check free space and write permissions on the project dir and cache dir (`df -h`, `ls -ld . ~/.bun/install/cache`)
- Free space / fix ownership, then rerun the command
- If it only happens when piping to `head`, note the lockfile printer already swallows it - otherwise avoid closing the pipe early
- In Docker/CI, ensure the workspace volume is writable by the bun user
Example fix
# before $ sudo bun install # node_modules owned by root $ bun install # WriteFailed for later runs # after $ sudo chown -R $(id -u):$(id -g) node_modules && bun install
Defensive patterns
Strategy: validation
Validate before calling
import { statfsSync, accessSync, constants } from "node:fs";
function canInstall(dir = process.cwd()) {
accessSync(dir, constants.W_OK);
const { bavail, bsize } = statfsSync(dir);
return bavail * bsize > 500 * 1024 * 1024; // require >=500MB free
} Prevention
- Preflight free disk space and write permissions on the project + cache dirs
- Never run bun install via sudo; fix directory ownership instead
- Give CI runners adequate disk so installs do not fail mid-write
When it happens
Trigger: Disk full or quota exceeded while writing node_modules, bun.lock, or cache files; permission denied on the target directory; stdout/stderr closed early by a consumer during a command that writes output.
Common situations: Full CI disks or container size limits; read-only workspace mounts; project or cache dir owned by another user (root via sudo bun); piping command output to `head`.
Related errors
- AccessDenied
- blob.text() failed
- Your package manager doesn't seem to support bun. To use bun
- Failed to write file ${file}
- FileNotFound
AI-assisted analysis of oven-sh/bun@8c5296ac45 (2026-08-16).
Data as JSON: /api/errors/cf3562f91d0a94ac.
Report an issue: GitHub.