Skip to content

EMFILE: too many open files, watch #180

Description

@kovkev

Hi! I am trying to build a react-native app on XCode. I see the following error.

Note that I am running on M1 with Rosetta (x86_64 architecture). I did the advice I found that is to brew reinstall watchman. I also did sudo launchctl limit maxfiles 65536 unlimited to increase the max open files limit.

warning: the transform cache was reset.
                    Welcome to Metro!
              Fast - Scalable - Integrated


/Users/kevin/pdev/tgkj/penpalling/node_modules/metro-hermes-compiler/src/emhermesc.js:81
          throw ex;
          ^

Error: EMFILE: too many open files, watch
    at FSEvent.FSWatcher._handle.onchange (node:internal/fs/watchers:204:21)
Emitted 'error' event on NodeWatcher instance at:
    at NodeWatcher.checkedEmitError (/Users/kevin/pdev/tgkj/penpalling/node_modules/sane/src/node_watcher.js:143:12)
    at FSWatcher.emit (node:events:390:28)
    at FSEvent.FSWatcher._handle.onchange (node:internal/fs/watchers:210:12) {
  errno: -24,
  syscall: 'watch',
  code: 'EMFILE',
  filename: null
}
Command PhaseScriptExecution failed with a nonzero exit code

How should I resolve this issue?

Thank you,

Kovkev

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions