Nodemon Error: “System limit for number of file watchers reached”

Updated (05/2023)

There are some tips in the comments and I brought them to update this question. If you’re facing this problem, then you are probably using a Linux distro and your project is hitting your system’s file watchers limit.

Check your current inotify file watch limit by executing:

$ cat /proc/sys/fs/inotify/max_user_watches

You can set a new limit temporarily with:

$ sudo sysctl fs.inotify.max_user_watches=131070
$ sudo sysctl -p

Or you can set a permanent limit:

echo fs.inotify.max_user_watches= 131070 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

Here we are setting 131070 file limit (as suggested by @Dmitriy in the comments). If this limit doesn’t works for your system you can twice this number.

This documentation provides more technical details.

Old answer

If you are using Linux, your project is hitting your system’s file watchers limit

To fix this, on your terminal, try:

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

Leave a Comment