Safe to Delete

Lerna Monorepo Build & Package Task Cache (.lerna)

Quick Answer: Lerna monorepo manager caches package build outputs and task graphs in .lerna and node_modules/.cache/lerna. Clearing Lerna cache is safe.

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 build re-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...

Related in developer

The AI Engineer's Model Disk Cleanup Guide: Hugging Face, Ollama & PyTorch

The ultimate 1,200-word field guide for AI developers and local LLM hobbyists to reclaim 200GB+ from Ollama, Hugging Face, PyTorch, and vLLM model weights.

Safe to Delete

Android Studio System Index Cache (AndroidStudio Cache)

Android Studio caches Gradle project indexes, VFS caches, and compiler artifacts. Invalidate and clear is safe.

Safe to Delete

Ansible Automation Temp & Fact Cache (~/.ansible/tmp)

Ansible stores temporary playbook execution modules and target host fact JSON caches in ~/.ansible/tmp. Clearing Ansible tmp is safe.

Safe to Delete
Back to all files