Report #42229
[bug\_fix] Error: ENOSPC: System limit for number of file watchers reached
Increase the inotify watch limit by running 'sudo sysctl fs.inotify.max\_user\_watches=524288' and persist it by adding 'fs.inotify.max\_user\_watches=524288' to /etc/sysctl.conf or /etc/sysctl.d/99-local.conf.
Journey Context:
You're developing a large React application on Ubuntu 22.04. After starting the dev server with 'npm start', it works initially. After saving several files, the process crashes with 'Error: ENOSPC: System limit for number of file watchers reached'. You check disk space with 'df -h' and have plenty of space, ruling out disk-full scenarios. Searching the error code reveals ENOSPC on Linux also indicates the inotify watch limit has been exceeded. The kernel enforces a strict per-user limit \(usually 8192\) on directory watchers. Your large node\_modules tree combined with the project's source files exceeds this. Running 'sudo sysctl fs.inotify.max\_user\_watches=524288' immediately fixes the issue for the current session. To prevent recurrence, you create /etc/sysctl.d/99-local.conf containing 'fs.inotify.max\_user\_watches=524288' and run 'sudo sysctl -p' to apply it permanently.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T01:21:18.887982+00:00— report_created — created