Reference / Fix an error

How to fix "No space left on device" on a Mac

Reclaim 20+ GB safely ยท reversible

Your disk is full and a command just failed with ENOSPC (errno 28). Here's how to find the culprits and reclaim 20+ GB safely โ€” without a blind rm -rf that nukes something you needed.

30-second triage

See how full you are and what's safe to clear:

$ df -h / # how full are you, really $ diskspace scan # survey the hold $ diskspace detect # rank what's reclaimable

What's usually eating it

Each links to a plain verdict โ€” does it come back if you delete it?

Is it safe to delete ~/.npm/_cacache on a Mac?~/.npm/_cacacheSafe to deleteIs it safe to delete node_modules folders on a Mac?**/node_modulesSafe to deleteIs it safe to delete ~/Library/Developer/Xcode/DerivedData on a Mac?~/Library/Developer/Xcode/DerivedDataSafe to deleteIs it safe to delete ~/Library/Caches/Homebrew on a Mac?~/Library/Caches/HomebrewSafe to deleteIs it safe to delete ~/Library/Containers/com.docker.docker/Data/vms on a Mac?~/Library/Containers/com.docker.docker/Data/vmsUsually safe

The one-command fix

diskspace frees exactly what you need, pressure-tests every candidate against live disk state, and stages it reversibly โ€” so an agent or a human can run it without fear.

$ brew install tymrtn/diskspace/diskspace $ diskspace doctor --need 20G --yes # scan โ†’ pressure-test โ†’ free