No space left on device (errno 28, ENOSPC) means a program tried to write and the disk said no. On a Mac it usually happens in the middle of something big: an Xcode archive, a Docker build, an npm install. Finder may still show a few GB free, because macOS counts purgeable space as available while a build needs it now.
1. See how much is really free
df -h /# the "Avail" column is what a build can use right now
2. Find what filled it
On a developer Mac it is almost always one of these. Check them in this order:
du -sh ~/Library/Developer/Xcode/DerivedDatadu -sh ~/Library/Developer/CoreSimulatordu -sh ~/Library/Developer/Xcode/iOS\ DeviceSupportdocker system dfdu -sh ~/.gradle ~/.npm ~/Library/Caches
And the build folders inside your projects: node_modules, Rust's target, .venv, Pods, .next. With many projects or git worktrees these add up to more than all of the above. How to find and delete them.
3. Free the space
Xcode
DerivedData, old simulator runtimes and device support are safe to remove; Xcode rebuilds or downloads them again. Step by step: how to delete DerivedData and the rest of Xcode's leftovers.
Docker and OrbStack
Inside Docker, no space left on device often means Docker's own disk is full, not your Mac's. The build cache is usually the biggest part:
docker system df# build cache, rebuilt by the next builddocker builder prune# images no tag points todocker image prune
Be careful with docker system prune --volumes and docker volume prune: volumes hold your databases and other data, and pruning them deletes it.
Docker Desktop keeps everything in one disk image with a size limit (Settings, Resources). If builds fail while your Mac has room, prune first, then raise the limit. OrbStack gives freed space back to macOS gradually, so Finder may lag behind.
Gradle and Android
~/.gradle/caches and old Gradle distributions are often 5 to 20 GB. How to clear the Gradle cache safely.
Package caches
npm cache clean --forcepnpm store prunebrew cleanup
Time Machine snapshots
Local snapshots count as purgeable. macOS removes them when it needs room, but not always before a build hits the wall. tmutil listlocalsnapshots / shows them.
4. Make sure it doesn't happen mid-build again
The leftovers come back: every build, simulator and install leaves new ones. Check before a long build instead of finding out an hour in. Sluice's command line tool does that in one line at the top of a script, and its MCP server lets coding agents like Claude Code and Cursor ask before they build (more on that).
# stop early when there's less than 25 GB freesluice check --min 25G || exit 1
Or let Sluice do it
Sluice shows the free space in your menu bar, warns when it runs low, and knows where Xcode, simulators, Docker, Gradle, EAS and your project folders keep their leftovers. It never cleans while a build runs and never touches Docker volumes. Sluice is free to download and clean with; Pro cleans every night and whenever space runs low.
macOS 14 Sonoma or later · Apple silicon and Intel · or brew install --cask qraft/tap/sluice
More guides
- Xcode DerivedData: where it is and how to delete it safely
- How to clear the Gradle cache on a Mac, and what is safe to delete
- Find and delete node_modules (and target, .venv, Pods) across all your projects
- A DevCleaner alternative for Macs that run more than Xcode
- A CleanMyMac alternative for developers