React Native "ENOSPC" while building the bundle in CI
ENOSPC means the system ran out of space, either disk or inotify watchers. React Native bundling writes large outputs and Metro watches many files, so both limits get hit on CI.
What this error means
The build fails with ENOSPC: no space left on device or ENOSPC: System limit for number of file watchers reached. It often appears only on the constrained runner.
react-native
Error: ENOSPC: System limit for number of file watchers reached, watch '/runner/work/app/node_modules'Common causes
Disk full on the runner
node_modules, Gradle caches, and bundle outputs can fill a small runner disk.
inotify watcher limit reached
Metro watches many files; the default watcher limit can be exceeded on Linux runners.
How to fix it
Free disk or raise the watcher limit
- Clean caches and unused files to reclaim disk.
- On Linux, raise the inotify watcher limit.
shell
sudo sysctl -w fs.inotify.max_user_watches=524288Use a larger runner
When the build legitimately needs more disk, a larger runner is the reliable fix.
How to prevent it
- Right-size runner disk and watcher limits and prune caches between steps. On Latchkey managed runners, transient ENOSPC and disk-pressure failures are auto-retried and larger runner sizes give the bundle more headroom. Android and JS builds run on Linux to control cost.
Related guides
React Native "bundling failed" (Metro) in CIFix the React Native "error: bundling failed" Metro error in CI by resolving the unresolved import, missing a…
Android Gradle "OutOfMemoryError" in CIFix Android Gradle OutOfMemoryError and Java heap exhaustion in CI by raising the Gradle and Kotlin daemon he…
React Native "Execution failed for task :app:installDebug" in CIFix the React Native "Execution failed for task :app:installDebug" error in CI by building (assemble) instead…