Bun "lockfile had changes, but lockfile is frozen" in CI
CI ran bun install --frozen-lockfile (the default in CI environments), but package.json does not match bun.lockb. Bun refuses to change the lockfile in frozen mode, so it fails instead of silently re-resolving.
What this error means
bun install fails with "lockfile had changes, but lockfile is frozen". It happens after someone edits dependencies in package.json without re-running bun install to update bun.lockb.
error: lockfile had changes, but lockfile is frozen
note: try re-running without --frozen-lockfileCommon causes
package.json edited without re-locking
A dependency was added, removed, or bumped in package.json, but bun.lockb was not regenerated, so the two disagree.
Lockfile not committed
If bun.lockb is gitignored or stale in the repo, CI cannot reproduce the resolved set and the frozen check fails.
How to fix it
Regenerate and commit the lockfile
Run a normal install locally to update the lockfile, then commit it.
bun install
git add bun.lockb && git commit -m "Update bun.lockb"Keep --frozen-lockfile in CI
Frozen installs are correct for CI - they guarantee reproducibility. Fix the lockfile drift rather than removing the flag.
bun install --frozen-lockfileHow to prevent it
- Run
bun installafter anypackage.jsonchange and commitbun.lockb. - Keep
--frozen-lockfilein CI to catch drift in PRs. - Do not gitignore
bun.lockb.