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

Error npm test on MacOs Sierra #871

Closed
manuelitox opened this Issue Oct 7, 2016 · 24 comments

Comments

Projects
None yet
@manuelitox

manuelitox commented Oct 7, 2016

Hey there,

I can't run with success the npm test command:

❯ npm test

> react-scripts test --env=jsdom
Determining test suites to run...2016-10-07 11:38 node[873] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
2016-10-07 11:38 node[873] (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:953:11)
    at FSEvent.FSWatcher._handle.onchange (fs.js:1400:11)
npm ERR! Test failed.  See above for more details.

Environment

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

  1. npm ls react-scripts: react-scripts@0.6.1
  2. node -v: v6.7.0
  3. npm -v: 3.10.3
  4. Operating system: MacOs Sierra

Any idea?

@manuelitox manuelitox changed the title from Error run npm test on MacOs Sierra to Error npm test on MacOs Sierra Oct 7, 2016

@manuelitox

This comment has been minimized.

manuelitox commented Oct 7, 2016

The issue was fixed to installing of watchman.

@gaearon

This comment has been minimized.

Member

gaearon commented Oct 7, 2016

Thanks for information! Yeah unfortunately it will likely take some time for the underlying dependencies to fix all Sierra issues.

@Peterlollo

This comment has been minimized.

Peterlollo commented Oct 10, 2016

In case the specificity helps anyone, I ran:

  • sudo chown -R $(whoami) /usr/local
  • brew update
  • brew install watchman
@gaearon

This comment has been minimized.

Member

gaearon commented Nov 16, 2016

Haha I just had this issue and your comment fixed it. Thanks!

@gaearon

This comment has been minimized.

Member

gaearon commented Jan 5, 2017

Another data point: I just had this on Node 6.9.1 but not on 6.3.1.

@jeff3dx

This comment has been minimized.

jeff3dx commented Aug 11, 2017

Installing watchman fixed it as mentioned above. If you get a password prompt enter your password then run all commands again. And if it's not obvious -- close and reopen your terminal or terminal tab after installing.

@afarriaga

This comment has been minimized.

afarriaga commented Sep 26, 2017

I had this same issue on node v8.3.0 & OSX v10.12.6 after pulling some changes in my project. However, I'm using yarn v1.0.1. What I've done to fix it is:

rm -rf ./node_modules
yarn cache clean
yarn

After that running yarn test works as before.

@arcecio

This comment has been minimized.

arcecio commented Nov 1, 2017

Thank you @Peterlollo !

@packetstracer

This comment has been minimized.

packetstracer commented Nov 23, 2017

brew install watchman

worked for me, using high Sierra 10.13.1

@mgan59

This comment has been minimized.

mgan59 commented Nov 24, 2017

well just spent 1.5 hours trying to get the test runner to work. brew install watchman saved the day.

@etiennejcharles

This comment has been minimized.

etiennejcharles commented Jan 9, 2018

Amazing work on finding that watchman is the case!
But... Is it only me? I feel like we're correcting symptoms ~ shouldn't watchman be

  1. Included in the create-react-app build process ?
  2. Mentioned in the documentation that watchman is required to run tests?

I'm not sure this should be closed.

@gaearon

This comment has been minimized.

Member

gaearon commented Jan 10, 2018

It's not required. The problem is that when it's not available, the alternative watcher doesn't always work and can die unexpectedly. The good news is we're updating to Jest 22 soon which falls back to yet another watcher when watchman isn't available—which doesn't have this issue.

@gaearon

This comment has been minimized.

Member

gaearon commented Jan 10, 2018

So this should all go away in the next major release.

@villesau

This comment has been minimized.

villesau commented Mar 13, 2018

This is still an issue with node@9.4.0, watchman@4.9.0 macOS@10.13.3 and react-scripts@1.1.1

@eddieduro

This comment has been minimized.

eddieduro commented Mar 17, 2018

@villesau still having the same issue as well, watchman doesn't fix the issue either.

@andrewtpoe

This comment has been minimized.

andrewtpoe commented Mar 21, 2018

I am also still having this issue. node@8.10.0, watchman@4.9.0, macOS@10.13.3, react-scripts@1.1.1

@andrewtpoe

This comment has been minimized.

andrewtpoe commented Mar 21, 2018

For me at least, it turned out I had an older version of watchman installed globally in npm. Uninstalling that got me working again.

@maciekgrzybek

This comment has been minimized.

maciekgrzybek commented Mar 27, 2018

Still having the same issue, installing Watchman didn't help. Any ideas guys ?

@PortableStick

This comment has been minimized.

PortableStick commented Mar 28, 2018

I'm currently having this issue. Installing watchman via Brew does eliminate the error, but for some reason Jest can't find my tests so I uninstalled it. I noticed that this problem started as I was making my latest commit, so I tried moving my .git folder out of my project. Lo-and-behold, watching tests works just fine. Moving it back in breaks the tests again.

@yashka713

This comment has been minimized.

yashka713 commented Mar 29, 2018

I got the same error using Travis CI :(

egmcdonald added a commit to egmcdonald/blabber that referenced this issue May 7, 2018

📦 Updated Jest version
This was required due to previous version having a known bug with Sierra and the watch command.

facebook/create-react-app#871

saimonmoore added a commit to saimonmoore/create-react-app that referenced this issue May 21, 2018

Warn about facebook#871 until it's actually fixed.
facebook#871 is still an issue on the latest version of react-scripts (1.1.4 at time of writing).

Rather than having people eventually find this issue and waste time, be more helpful and provide a note in the readme so people are aware this is an issue and don't waste time.

create-react-app is great for people that are learning react and this issue affects them negatively.

This note can be removed once the issue is fixed.

saimonmoore added a commit to saimonmoore/create-react-app that referenced this issue May 21, 2018

Merge pull request #1 from saimonmoore/saimonmoore-patch-readme-templ…
…ate-issue-871

[Read Me template patch] Warn about facebook#871 until it's actually fixed.
@saimonmoore

This comment has been minimized.

Contributor

saimonmoore commented May 21, 2018

I'm on react-scripts 1.1.4 and just had this issue.

I wasted a lot of time before I found #871. Let's try and help others to avoid this pain? (#4497)

@mynameistechno

This comment has been minimized.

mynameistechno commented Jun 3, 2018

I'm using create-react-app and following instructions here:

https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#testing-components

Removing jest-enzyme fixed the error for me. I'll try downgrading jest-enzyme to see if it helps.

1 similar comment
@mynameistechno

This comment has been minimized.

mynameistechno commented Jun 3, 2018

I'm using create-react-app and following instructions here:

https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#testing-components

Removing jest-enzyme fixed the error for me. I'll try downgrading jest-enzyme to see if it helps.

edieblu referenced this issue in Bahmni/person-management-app Jul 15, 2018

@prisar

This comment has been minimized.

prisar commented Sep 19, 2018

Installing worked @afarriaga

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment