Skip to content
Latchkey

ENOSPC Building Assets - Fix in CI

Asset-heavy builds write large temp and output files. When the runner disk fills, writes fail with ENOSPC mid-build. Faster, larger managed runners (Latchkey) provide more disk headroom and auto-retry transient capacity failures.

What this error means

The build fails with ENOSPC: no space left on device while writing assets or to the output directory.

node
Error: ENOSPC: no space left on device, write
    at Object.writeSync (node:fs:921:3)
    at writeAsset (/app/node_modules/.../emit.js)

Common causes

Runner disk exhausted

Cached layers, node_modules, and large asset outputs filled the small ephemeral disk.

Large temporary asset files

Image processing or source maps wrote big intermediates that overflowed available space.

How to fix it

Free disk before the build

  1. Prune caches and unneeded files, then check free space.
Terminal
npm cache clean --force
df -h

Use a runner with more disk

  1. Build assets on a runner sized for the output, and disable unneeded large source maps.
CI config
# build with larger disk; skip prod source maps if not needed

How to prevent it

  • Right-size runner disk to the build output and clean caches between steps.
  • Avoid emitting large artifacts you do not ship.

Frequently asked questions

What causes "ENOSPC"?
Cached layers, node_modules, and large asset outputs filled the small ephemeral disk.
How do I fix ENOSPC?
Free disk before the build

Related guides

References

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