简体   繁体   中英

“Error watching file for changes: EMFILE” when init a react-native project

I want to init a react-native project, and steps:

First react-native init testproject then react-native run-ios

Error watching file for changes: EMFILE
{"code":"EMFILE","errno":"EMFILE","syscall":"Error watching file for changes:","filename":null}
Error: Error watching file for changes: EMFILE
    at exports._errnoException (util.js:1008:11)
    at FSEvent.FSWatcher._handle.onchange (fs.js:1406:11)

Operation System Edition: OS X 10.12

Reinstalling watchman fixed this error for me.

brew uninstall watchman
brew install watchman

One more thing that worked for my teammate and may work for you is deleting node_modules directory completely and running

npm install

Note that yarn install did not work in this case.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM