oven-sh/bun · error · Error

Unexpected lockfile version

Error message

Unexpected lockfile version

What it means

The lockfile's version field is newer than any version this Bun understands — the file was produced by a NEWER Bun. It fires at parse time when the stored lockfile version is greater than the maximum supported.

Solutions

  1. Upgrade Bun to the version that wrote the lockfile
  2. Or delete bun.lock and regenerate with the current Bun (coordinate with the team)
Defensive patterns

Strategy: fallback

When it happens

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

Appendix: source

Thrown at src/install/error.rs:167

    #[error("Fail")]
    Fail,
    #[error("IntegrityCheckFailed")]
    IntegrityCheckFailed,
    #[error("RepositoryNotFound")]
    RepositoryNotFound,
    #[error("DebugTextLockfileRoundTrip")]
    DebugTextLockfileRoundTrip,
    #[error("NoPackage")]
    NoPackage,
    #[error("BrokenPipe")]
    BrokenPipe,
    #[error("WriteFailed")]
    WriteFailed,
    #[error("InvalidCharacter")]
    InvalidCharacter,
    #[error("InvalidLockfile")]
    InvalidLockfile,
    #[error("Unexpected lockfile version")]
    UnexpectedLockfileVersion,
    #[error("Outdated lockfile version")]
    OutdatedLockfileVersion,
    #[error("Lockfile is missing data")]
    LockfileIsMissingData,
    #[error("Lockfile is malformed (expected 0 at the end)")]
    LockfileIsMalformedExpected0AtTheEnd,
    #[error("CorruptLockfile")]
    CorruptLockfile,
    #[error("Lockfile is missing resolution data")]
    LockfileIsMissingResolutionData,
    #[error("MissingPackageName")]
    MissingPackageName,
    #[error("GlobError")]
    GlobError,
    #[error("Invalid")]
    Invalid,
    #[error("Lockfile validation failed: list is impossibly long")]

View on GitHub (pinned to 8c5296ac45)