oven-sh/bun · error · bun_install::Error

InvalidPackageID

Error message

InvalidPackageID

What it means

A package identifier string failed validation while parsing — for example an id from the lockfile or an internal package id does not match the expected `name@version` format. It fires when the id cannot be decomposed into name and version.

Solutions

  1. Regenerate the lockfile (`rm bun.lock && bun install`) to rebuild package ids
  2. Check that dependency names/versions in package.json are well-formed
  3. Upgrade Bun if the id was produced by a newer lockfile format
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/install/error.rs:75 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/5315c036dbbb0e25. Report an issue: GitHub.

Appendix: source

Thrown at src/install/error.rs:75

    #[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")]
    SecurityScannerInWorkspace,
    #[error("SecurityScannerRetryFailed")]
    SecurityScannerRetryFailed,
    #[error("IPCPipeFailed")]
    IPCPipeFailed,
    #[error("JSONPipeWriterFailed")]
    JSONPipeWriterFailed,
    #[error("ProcessWatchFailed")]
    ProcessWatchFailed,
    #[error("SecurityScannerProcessFailedWithoutExitStatus")]
    SecurityScannerProcessFailedWithoutExitStatus,
    #[error("NoSecurityScanData")]

View on GitHub (pinned to 8c5296ac45)