oven-sh/bun · error · bun_install::Error
MissingPackageJSON
Error message
MissingPackageJSON
What it means
A required package.json is absent where one was expected — typically when installing in a directory that has no package.json (and no workspace root found), or when a dependency's tarball contains no package.json.
Solutions
- Run `bun init` or create a package.json before installing
- If installing a dependency, verify the package name — it may not exist or its tarball is broken
- For workspaces, ensure the command runs inside the workspace tree
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at src/install/error.rs:63 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of oven-sh/bun@8c5296ac45 (2026-08-16).
Data as JSON: /api/errors/5f5e7bcf7e8896d4.
Report an issue: GitHub.
Appendix: source
Thrown at src/install/error.rs:63
#[error("PackageFailedToParse")]
PackageFailedToParse,
#[error("BufferTooSmall")]
BufferTooSmall,
#[error("DanglingSymlink")]
DanglingSymlink,
#[error("UnsupportedYarnLockfileVersion")]
UnsupportedYarnLockfileVersion,
#[error("InvalidPackageJSON")]
InvalidPackageJSON,
#[error("LockfileResolveFailed")]
LockfileResolveFailed,
#[error("DistTagNotFound")]
DistTagNotFound,
#[error("NoMatchingVersion")]
NoMatchingVersion,
#[error("TooRecentVersion")]
TooRecentVersion,
#[error("MissingPackageJSON")]
MissingPackageJSON,
#[error("InstallFailed")]
InstallFailed,
#[error("HTTPError")]
HTTPError,
#[error("Failed")]
Failed,
#[error("UnrecognizedDependencyFormat")]
UnrecognizedDependencyFormat,
#[error("No global directory found")]
NoGlobalDirectoryFound,
#[error("InvalidPackageID")]
InvalidPackageID,
#[error("PartialInstallFailed")]
PartialInstallFailed,
#[error("NoPackagesInstalled")]
NoPackagesInstalled,
#[error("SecurityScannerInWorkspace")]View on GitHub (pinned to 8c5296ac45)