(FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)

Tryliom picture Tryliom · Jul 4, 2018 · Viewed 8.4k times · Source

When I run react-scripts test --env=jsdom it always display:

2018-07-04 09:57 node[61600] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
2018-07-04 09:57 node[61600] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
2018-07-04 09:57 node[61600] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
events.js:167
      throw er; // Unhandled 'error' event
      ^

Error: EMFILE: too many open files, watch
    at FSEvent.FSWatcher._handle.onchange (fs.js:1370:28)
Emitted 'error' event at:
    at FSEvent.FSWatcher._handle.onchange (fs.js:1376:12)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] test: `react-scripts test --env=jsdom`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] test 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:
npm ERR!     /Users/alexis/.npm/_logs/2018-07-04T07_57_39_147Z-debug.log

npm version: 6.1.0
I am under macOS High Sierra 10.13.5

I have seen other issue like this but they have that with watchman that I don't use.

Thanks for help.

Answer

Felipe Amorim picture Felipe Amorim · Jul 8, 2018

try it:

brew install watchman

It worked to me.