Skip to content

Disk full? "No space left on device"

When a build, install or docker pull fails with

ENOSPC: no space left on device
write /tmp/...: no space left on device
There is not enough space on the disk.

the usual cause on a developer machine isn't your files: it's caches and build folders that tools never clean up. npm, Docker, Gradle, Go and old projects' node_modules easily take 50–100 GB.

See what's taking the space

npx diskdiet

Nothing to install, and it changes nothing. You get every cache, biggest first, with how much hasn't been used for 30 days:

WHAT           SIZE      CAN FREE           WHERE
npm cache      41.3 GB   33.8 GB            ~/.npm
Docker         14.6 GB   up to 9.2 GB       docker (Docker Desktop)
node_modules   11.2 GB   5.4 GB (5 of 41)   41 folders under ~

Free it

npx diskdiet clean

It shows exactly what it will remove and asks first. Removed cache entries download again when a project needs them.

Need more? --older-than 7d counts more as old; --all counts everything.

By cause

In VS Code

The diskdiet extension notices "no space left on device" in the terminal and offers to free space right there.