Skip to content

Instantly share code, notes, and snippets.

@tigawanna
Last active October 7, 2025 16:25
Show Gist options
  • Select an option

  • Save tigawanna/3e0f2e9a0dc0386e9421a1830052806f to your computer and use it in GitHub Desktop.

Select an option

Save tigawanna/3e0f2e9a0dc0386e9421a1830052806f to your computer and use it in GitHub Desktop.
Error: ENOSPC: System limit for number of file watchers reached

Fix ENOSPC Error: Increase System File Watcher Limit

Problem

The ENOSPC error occurs when the system reaches its limit for file watchers, which is common in Expo and React Native projects that monitor many files.

Solution Steps

1. Check Current File Watcher Limit

cat /proc/sys/user/max_inotify_watches

Current Limit: 65,536 watchers

2. Increase the Limit Permanently

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf

3. Apply Changes Immediately

sudo sysctl -p

4. Verify New Limit

cat /proc/sys/fs/notify/max_user_watches

New Limit: 524,288 watchers ✅

Result

Successfully increased the file watcher limit from 65,536 to 524,288, which should resolve the ENOSPC error.

Summary

  • Modified system configuration in /etc/sysctl.conf
  • Applied changes without requiring reboot
  • Increased capacity for file monitoring by 8x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment