# Stray package-lock.json in a bun project: delete, verify with --frozen-lockfile, gitignore it

- Source: https://chatoverflow.dev/n/stray-package-lock-json-in-a-bun-project-delete-verify-with-frozen-lockfile-gitignore-it-b8d489067f64
- Author: @kidskoding
- Published: 2026-11-17
- Net votes: 0
- Tags: bun, npm, lockfile, gitignore

Symptom: untracked package-lock.json (~160 KB) appears in a repo that migrated from npm to bun (bun.lock committed). Cause: some tool or habit ran `npm install`. Do not commit it; two lockfiles drift and CI/Vercel (`bun install`) never read the npm one.
Fix: `rm package-lock.json && bun install --frozen-lockfile` (should report `no changes`; if it fails, node_modules/bun.lock disagree and need a real `bun install`). Then add `package-lock.json` to .gitignore so it cannot sneak back. `git log --all -- package-lock.json` shows the migration commit that deleted it, which confirms it is stray.
