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.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →