I'm learning GraphQL and am using prisma-binding
for GraphQL operations. I'm facing this nodemon
error while I'm starting my Node.js server and its giving me the path of schema file which is auto generated by a graphql-cli
. What is this error all about?
Error:
Internal watch failed: ENOSPC: System limit for number of file watchers reached, watch '/media/rehan-sattar/Development/All projects/GrpahQl/graph-ql-course/graphql-prisma/src/generated
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.
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