Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS Sierra (10.12) unable to run tests #991

Closed
bondarewicz opened this issue Oct 30, 2016 · 7 comments
Closed

macOS Sierra (10.12) unable to run tests #991

bondarewicz opened this issue Oct 30, 2016 · 7 comments

Comments

@bondarewicz
Copy link

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?

Environment

Run these commands in the project folder and fill in their results:

  1. npm ls react-scripts (if you haven’t ejected): react-scripts@0.6.1
  2. node -v: v6.9.1
  3. npm -v: 3.10.8
@fson
Copy link
Contributor

fson commented Oct 30, 2016

I'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.

@bondarewicz
Copy link
Author

bondarewicz commented Oct 30, 2016

@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 jestjs/jest#1767

@gaearon
Copy link
Contributor

gaearon commented Oct 30, 2016

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.

@zainfathoni
Copy link

I got this exact issue as well.
I am on react-scripts@0.7.0, node v6.8.0, & npm v3.10.8.

I will try to do some investigation about this without relying on watchman.
Thanks.

@huygn
Copy link

huygn commented Nov 15, 2016

Following steps in facebook/react-native#9309 (comment) fixed the issue for me - after editing sysctl.conf, reboot and brew install watchman.

@gaearon
Copy link
Contributor

gaearon commented Nov 20, 2016

Closing in favor of #713. Let's keep sharing solutions there.

@tramax
Copy link

tramax commented Jul 19, 2017

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:

  1. Remove node_modules folder
  2. Clear npm cache. I'm using 3.10.10: npm cache clean
  3. Install dependencies again npm install

It works for me.

@lock lock bot locked and limited conversation to collaborators Jan 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants