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 install
Verify versions
bun pm ls react
bun pm ls @ffmpeg/ffmpeg
Ensure the package versions match package.json
.
Lockfile hygiene
- Commit
bun.lock
with dependency changes. - Avoid mixing
npm install
andbun install
in one branch. - Run
bun pm dedupe
after 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.