ProjectStack
npm

Error: ENOSPC — no space left on device

Either your disk is full and Node.js can't write files, or you've hit the Linux system limit for inotify file watchers (which also reports as ENOSPC). The file watcher variant is very common in large projects.

Common causes

  • Linux inotify watcher limit exceeded — too many files being watched by dev tools
  • Actual disk space is full — no room to write files or npm cache
  • Running many concurrent dev servers each watching large node_modules trees
  • Docker container running with limited disk quota

How to fix it

  1. For the watcher limit (most common): echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
  2. Check disk space: df -h
  3. Clear npm cache to free space: npm cache clean --force
  4. Delete old node_modules in other projects: find ~ -name 'node_modules' -type d -maxdepth 4

Example

Error: ENOSPC: System limit for number of file watchers reached, watch '/home/user/project/src'

Starting a webpack or Vite dev server in a large monorepo on Linux

Have a different error?

Paste any error message into the Error Translator to get an instant explanation.