8

To run the app, choose one of: › Scan the QR code above with the Expo app (Android) or the Camera app (iOS). › Press a for Android emulator, or i for iOS simulator, or w to run on web. › Press e to send a link to your phone with email.

Press ? to show a list of all available commands. Logs for your project will appear below. Press Ctrl+C to exit. Error: EMFILE: too many open files, watch at FSEvent.FSWatcher._handle.onchange (internal/fs/watchers.js:178:28) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! @ start: expo start npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the @ start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:

Ike
  • 81
  • 2
  • Please add a [mre]. – codedge Jan 28 '21 at 12:45
  • 2
    Is it true, that your system is macOS Big Sur 11.1? We're facing the same problem there. On macOS Catalina 10.15.7 everything is fine. – Kurt Lagerbier Jan 29 '21 at 17:17
  • In this GitHub issue https://github.com/taskrabbit/ReactNativeSampleApp/issues/48 they propose to install watchman: https://facebook.github.io/watchman/docs/install.html – Kurt Lagerbier Jan 29 '21 at 17:20
  • Me again: I can confirm that installing watchman (see comment above) did the trick for macOS Big Sur 11.1. Expo client is running. But I really don't know if this is your issue. As said: Please add some more information to your problem, so we can help you. – Kurt Lagerbier Jan 29 '21 at 18:18
  • 1
    For me, this issue happened as a result of bumping up either NPM to 7.6.2 or NODE to 14.16.10 (from ~v12). – Devin B. Mar 11 '21 at 19:42
  • Similar if not duplicate threads: https://stackoverflow.com/questions/65752638/expo-developer-tools-is-disconnected-from-expo-cli-when-trying-to-run-react-n https://stackoverflow.com/questions/65172632/react-native-command-phasescriptexecution-failed-with-a-nonzero-exit-code – Devin B. Mar 11 '21 at 19:59

2 Answers2

9
brew install watchman

running this command solved my exactly same problem. if you look at the error message you are getting, it says:

Error: EMFILE: too many open files, watch at FSEvent.FSWatcher._handle.onchange.

react native is able to use watchman internally to watch its files. I hope this will work for your as well

Oybek Toshmatov
  • 407
  • 5
  • 11
4

Oybek's solution did not work for me, but it would work if had Intel based Mac computer.

For those who have Apple M1 Silicon based machine such command may be daysaver:

arch -arm64 brew install watchman

or

arch -arm64 brew reinstall watchman

when you have some bad installation of watchman already done.

RadekR
  • 503
  • 3
  • 10