After upgrading to sierra I've got the following error being thrown each time I run npm test
Determining test suites to run...
2016-10-30 15:28 node[763] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
2016-10-30 15:28 node[763] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
2016-10-30 15:28 node[763] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
events.js:160
throw er; // Unhandled 'error' event
^
Error: Error watching file for changes: EMFILE
at exports._errnoException (util.js:1026:11)
at FSEvent.FSWatcher._handle.onchange (fs.js:1406:11)
npm ERR! Test failed. See above for more details.
So far unable to find any fixes, anyone?
Run these commands in the project folder and fill in their results:
npm ls react-scripts (if you haven鈥檛 ejected): [email protected] node -v: v6.9.1npm -v: 3.10.8I'm not sure if this helps, but can you try running npm rebuild in your project to rebuild the native addons in your dependencies? When I start seeing weird errors from fsevents and other native dependencies after an OS or Node upgrade, it's usually because of this.
@fson thanks for the tip, unfortunately this does not solve the issue...
I found the following link however following also doesn't fix it :(
# check open file limit
sysctl kern.maxfiles
# edit sysctl
sudo vim /etc/sysctl.conf
# add these two lines
kern.maxfiles=10485760
kern.maxfilesperproc=1048576
# reboot
sudo reboot
# check new file limit
sysctl kern.maxfiles
EDIT: just found that installing watchman fixes an issue, from https://github.com/facebook/jest/issues/1767
It would be great if you could spend some time debugging what happens without watchman. Many people had and keep having this issue but nobody helped investigate it so far.
I got this exact issue as well.
I am on [email protected], node v6.8.0, & npm v3.10.8.
I will try to do some investigation about this without relying on watchman.
Thanks.
Following steps in https://github.com/facebook/react-native/issues/9309#issuecomment-238966924 fixed the issue for me - after editing sysctl.conf, reboot _and_ brew install watchman.
Closing in favor of #713. Let's keep sharing solutions there.
I don't have watchman. Some comment in related issues suggested the problem is caused by the dependencies when your app grows larger. I tried this:
node_modules foldernpm cache cleannpm installIt works for me.
Most helpful comment
It would be great if you could spend some time debugging what happens without watchman. Many people had and keep having this issue but nobody helped investigate it so far.