Clear Bun Cache Issues in OpenCut
Bun aggressively caches packages. When lockfiles change or a dependency publishes a bad build, clear the cache and reinstall.
Cleanup script
rm -rf ~/.bun/install/cache
rm -rf node_modules .turbo .next
bun installVerify versions
bun pm ls react
bun pm ls @ffmpeg/ffmpegEnsure the package versions match package.json.
Lockfile hygiene
- Commit
bun.lockwith dependency changes. - Avoid mixing
npm installandbun installin one branch. - Run
bun pm dedupeafter large upgrades.
Diagram
flowchart LR
A[Cached metadata] --> B[Clear ~/.bun/install/cache]
B --> C[Remove node_modules]
C --> D[bun install]
D --> E[Fresh dependency graph]
If the error persists, try pnpm install to isolate whether the upstream package is broken before returning to Bun.