Skip to content
Latchkey

Runner Out of Disk During npm install (ENOSPC)

An npm install failed writing to disk. Large dependency trees plus the npm cache can fill a small runner disk, surfacing as ENOSPC mid-install.

What this error means

Install aborts with ENOSPC: no space left on device, write, often while extracting tarballs into node_modules. A fresh runner or a cache prune fixes it with no package.json change.

shell
npm error code ENOSPC
npm error syscall write
npm error errno -28
npm error nospc ENOSPC: no space left on device, write

Common causes

node_modules plus the npm cache fill the disk

Large dependency trees and a growing ~/.npm cache consume space fast, especially on reused runners.

Leftover state from earlier jobs

Old node_modules, build outputs, and caches from prior steps leave little room for a clean install.

How to fix it

Reclaim space and prune the npm cache

Free room before installing.

shell
df -h
rm -rf node_modules
npm cache clean --force
npm ci

Install leaner or on a bigger disk

  1. Use npm ci (clean, reproducible) over repeated npm install.
  2. Cache dependencies instead of keeping every install on the runner disk.
  3. Move heavy installs to a runner with a larger disk.

How to prevent it

  • Prune ~/.npm periodically on long-lived runners.
  • Right-size disk for projects with large dependency trees.
  • Watch df -h before and after install in CI.

Frequently asked questions

What causes "npm install out of disk"?
Large dependency trees and a growing ~/.npm cache consume space fast, especially on reused runners.
How do I fix npm install out of disk?
Free room before installing.
Can Latchkey fix this automatically?
Yes. Latchkey runs your GitHub Actions on managed runners that detect this failure, apply the fix, and retry the job automatically - self-healing is on by default.

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card