Search code examples
reactjswatchman

Watchpack Error (watcher): Error: ENOSPC: System limit for number of file watchers reached


This morning when running npm start, I get the error:

System limit for number of file watchers reached

Because /proc/sys/fs/inotify/max_user_watches has returned to its initial value (8192) (How to Increase max_user_watches)

I'm on a new React@17 project with MaterialUI & formik. This post show the commands I ran to get started.

By modifying max_user_watches to 81920 it's work. However I would like to lower the consumption of my CPU/RAM

**How to tell my project (react VSC) to be less greedy **


Solution

  • I was also facing the same problem and tried the following command,

    sudo sysctl fs.inotify.max_user_watches=524288