react-nativeexpo

How to fix Too many open files error in React Native?


I'm using React Native 40.0.1 and I am getting the following error when running yarn start or expo start:

Error: EMFILE: too many open files, watch
    at FSEvent.FSWatcher._handle.onchange (node:internal/fs/watchers:204:21)

I've tried brew install watchman as this was suggested by multiple GH issues and SO posts that I visited. This didn't fix the issue.

I'm using NodeJS 16.14.2 (expo doesn't officially support 17) with expo-cli 5.4.12.

package.json and yarn.lock can be found on this GitHub Gist:

https://gist.github.com/DillonB07/5ea28e083074333879bae52b6134ee2c

My OS is macOS Catalina 10.15.7 with an Intel Chip.

How do I fix this issue?


Solution

  • It worked after I updated my dependencies. I was using old dependencies because they were supposed to work for my project, but apparently there was an issue somewhere.