jest: Error: Error watching file for changes: EMFILE
I know others have posted this issue, but it seems that they are aging and using old versions. I have tried everything from other issues.
Here is the error I get:
$ jest --watch # or with $ jest --watch --no-watchman
2017-05-02 09:49 node[8980] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
2017-05-02 09:49 node[8980] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
2017-05-02 09:49 node[8980] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
events.js:163
throw er; // Unhandled 'error' event
^
Error: Error watching file for changes: EMFILE
at exports._errnoException (util.js:1050:11)
at FSEvent.FSWatcher._handle.onchange (fs.js:1376:11)
error Command failed with exit code 1.
Versions:
- node: v7.9.0
- jest: 19.0.2
- watchman: 4.7.0 (installed via brew)
- mac: Sierra 10.12.4 (16E195)
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 28
- Comments: 23 (1 by maintainers)
Commits related to this issue
- Upgrade jest to address issue facebook/jest#3436 — committed to truffle-box/react-box by gnidan 7 years ago
- Upgrade jest to address issue facebook/jest#3436 — committed to truffle-box/react-uport-box by gnidan 7 years ago
- Merge pull request #10 from truffle-box/jest-upgrade Upgrade jest to address issue facebook/jest#3436 — committed to truffle-box/react-box by OnlyOneJMJQ 7 years ago
- Merge pull request #10 from truffle-box/upgrade-jest Upgrade jest to address issue facebook/jest#3436 — committed to truffle-box/react-uport-box by OnlyOneJMJQ 7 years ago
- lock jest to ^21.2.1 (https://github.com/jaegertracing/jaeger-ui/pull/102) to resolve https://github.com/facebook/jest/issues/3436 — committed to J22Melody/test-fullstack by J22Melody 6 years ago
- lock jest to ^21.2.1 (https://github.com/jaegertracing/jaeger-ui/pull/102) to resolve https://github.com/facebook/jest/issues/3436 — committed to J22Melody/test-fullstack by J22Melody 6 years ago
brew install watchman
worked for me.And have you tried it with watchman (
brew install watchman
)?brew install watchman
worked for me too using NodeJS v6.9 but what I don’t understand is the watchman dependence itself. Is this a dependency of the NodeJS version on Mac OS X Sierra? Where does this fit in the dependency tree?brew install watchman
worked for me.I had this error, but found that if I changed the command I used to run jest in watch mode, it worked.
became:
ditto to watchman
I get similar error when i install “pact” and then i tried to run npm test. I using create-react-app to setup my project and using node v7.9.0
Same here, it did not work with
jest --watch
orjest --watch --no-watchman
(watchman was not installed):I installed watchman using brew, and
jest --watch
now works.jest --watch --no-watchman
still fails.Jest v20.0.4 Node v7.10.0 MacOS 10.12.5
The extra
--
is the delimiter that tells npm to forward the remaining parameters to the referenced script.npm run test -- --watch
would runjest --watch
butnpm run test --watch
would ignore the argument and just runjest
. You can verify this in your console output.This problem exists with the following versions
It works in
https://github.com/facebook/jest/issues/1767#issuecomment-313434888
Yes, the error is present in
v20.0.0
.