"观看文件更改时出错:EMFILE"在init一个本机反应项目时

时间:2016-09-24 13:32:02

标签: javascript reactjs npm react-native watchman

我想初始化一个本地反应项目,并采取步骤:

首先react-native init testproject 然后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)

操作系统版:OS X 10.12

1 个答案:

答案 0 :(得分:3)

重新安装守望者为我修复了这个错误。

brew uninstall watchman
brew install watchman

对我的队友有用并且可能对你有用的另一件事是完全删除node_modules目录并运行

npm install

请注意yarn install在这种情况下不起作用。