Report #7118
[bug\_fix] npm ERR\! code ENOSPC
If disk full: Clean npm cache \(npm cache clean --force\), remove node\_modules, and reinstall. If inotify watchers exhausted \(Linux\): Increase the limit with echo fs.inotify.max\_user\_watches=524288 \| sudo tee -a /etc/sysctl.conf && sudo sysctl -p. If in Docker, increase the volume size or use npm ci with better caching. Root cause: ENOSPC can mean literal disk full OR the inotify watch limit on Linux systems is hit by file watchers \(npm, webpack, jest --watch\) monitoring thousands of files in node\_modules.
Journey Context:
Developer runs npm install in a large monorepo or inside a Docker container. Gets npm ERR\! code ENOSPC. Checks disk space with df -h, sees plenty of space available. Confused by 'No space'. Tries cleaning npm cache, no change. Deletes node\_modules, same error on reinstall. Realizes they are on Linux and the error might be about inotify watchers. Checks sysctl fs.inotify.max\_user\_watches, sees 8192. Realizes that with 50k files in node\_modules and IDE file watchers, the limit is exceeded. Increases max\_user\_watches to 524288. Runs npm install again, succeeds. Alternatively, in Docker, realizes the overlay2 storage is full despite df showing space, prunes images and increases Docker Desktop disk image size. Learns ENOSPC has two meanings in Node context.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T01:49:38.407864+00:00— report_created — created