I'm trying to Archive React Native app, but I'm receiving this error:
Error: EMFILE: too many open files, watch
at FSEvent.FSWatcher._handle.onchange (internal/fs/watchers.js:178:28)
Emitted 'error' event on NodeWatcher instance at:
at NodeWatcher.checkedEmitError (/Users/username/Dev/project/node_modules/sane/src/node_watcher.js:143:12)
at FSWatcher.emit (events.js:376:20)
at FSEvent.FSWatcher._handle.onchange (internal/fs/watchers.js:184:12) {
errno: -24,
syscall: 'watch',
code: 'EMFILE',
filename: null
}
Building an app via a simulator or real device works well, the only problem is when I try to run Archive.
I have installed watchman so that is not the issue.
Here is my setup:
MacBook Pro (13-inch, M1, 2020)
BigSur 11.4
React Native: 0.62.3
Node: v12.22.1
xCode: 12.5
Did anyone face the same issue, is there any solution how to fix this?