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

Tut*_*uuu 8 testing fsevents reactjs

当我运行react-scripts test --env=jsdom它时总是显示:

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! stampling@0.1.0 test: `react-scripts test --env=jsdom`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the stampling@0.1.0 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
Run Code Online (Sandbox Code Playgroud)

npm版本:6.1.0
我在macOS High Sierra 10.13.5下

我已经看到了这样的其他问题,但他们与我不使用的守望者有关.

感谢帮助.

小智 17

试试吧:

brew install watchman
Run Code Online (Sandbox Code Playgroud)

它对我有用.