Bottom Line: It is 100% safe to delete Lerna task caches. Lerna uses Nx-powered caching under the hood to accelerate multi-package builds. Wiping the cache forces Lerna to run tasks cleanly.
Why Does Lerna Build Cache Exist?
Lerna manages JavaScript and TypeScript monorepos containing multiple packages (e.g. packages/core, packages/ui). When executing lerna run build, Lerna caches task outputs inside node_modules/.cache/lerna.
- Primary Purpose: Monorepo package task orchestration and build output caching.
- Storage Growth: Grows as you run builds, lints, and package tests across multiple monorepo packages.
- Storage Impact: Consumes 1 GB to 10 GB+ over time.
What Happens If You Delete Lerna Cache?
- System Safety: ✅ 100% Safe to Delete. Source code inside
packages/is completely preserved. - Task Execution: Running
npx lerna run buildre-compiles all monorepo packages. - Reclaimed Storage: Frees 1 GB to 10 GB+ of SSD space.
How to Clear Lerna Cache
# Clear Lerna task cache
rm -rf node_modules/.cache/lerna .lerna
Frequently Asked Questions (FAQ)
Will clearing Lerna cache reset published npm package versions?
No. Lerna versioning metadata is stored in lerna.json and package package.json files. Cache folders contain no version history.
Discussion
Loading authentication...