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

Watch mode stopped working on macOS Sierra #1767

Closed
Anahkiasen opened this Issue Sep 22, 2016 · 135 comments

Comments

Projects
None yet
@Anahkiasen

Anahkiasen commented Sep 22, 2016

This is a bug that seems to happen ever since I've updated to Sierra.

Whenever I want to run Jest in --watch mode it crashes:

$ jest --watch
2016-09-22 10:49 node[79167] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
2016-09-22 10:49 node[79167] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
2016-09-22 10:49 node[79167] (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:1036:11)
    at FSEvent.FSWatcher._handle.onchange (fs.js:1406:11)

Tried reinstalling the node modules, checking for any updates and anything. I can't seem to reproduce it on a new project but on the other hand even if I just run an empty test suite with --testPathPattern it still crashes, so I'm guessing it's a dependency conflict somewhere. I don't have any setup files or anything, it's literally running an empty file and crashing.

I don't get any more output with --debug so not sure what else to provide to help. This does not happen with --watchman

$ node --version && npm --version && jest --version
v6.6.0
3.10.8
v15.1.1
@robzolkos

This comment has been minimized.

Show comment
Hide comment
@robzolkos

robzolkos Sep 22, 2016

I had the same issue. Upgrading watchman with brew install watchman to v4.7.0 fixed it.

robzolkos commented Sep 22, 2016

I had the same issue. Upgrading watchman with brew install watchman to v4.7.0 fixed it.

@cpojer

This comment has been minimized.

Show comment
Hide comment
@cpojer

cpojer Sep 22, 2016

Contributor

I'm quite confident this is not a Jest issue but either an underlying module or something else on your system. Unsure how to troubleshoot, everything is fine here on Sierra.

Contributor

cpojer commented Sep 22, 2016

I'm quite confident this is not a Jest issue but either an underlying module or something else on your system. Unsure how to troubleshoot, everything is fine here on Sierra.

@gaearon

This comment has been minimized.

Show comment
Hide comment
@gaearon

gaearon Sep 23, 2016

Member

I also got a similar report about Sierra: facebook/create-react-app#713

Member

gaearon commented Sep 23, 2016

I also got a similar report about Sierra: facebook/create-react-app#713

@gaearon

This comment has been minimized.

Show comment
Hide comment
@gaearon

gaearon Sep 23, 2016

Member

@cpojer Do you have a Sierra? Have you tried 6.6.0 on it?

Member

gaearon commented Sep 23, 2016

@cpojer Do you have a Sierra? Have you tried 6.6.0 on it?

@gaearon

This comment has been minimized.

Show comment
Hide comment
@gaearon

gaearon Sep 23, 2016

Member

Per facebook/create-react-app#713 (comment), uninstalling Watchman fixes the issue so it’s either a problem with Watchman, or its Jest integration on Sierra.

Member

gaearon commented Sep 23, 2016

Per facebook/create-react-app#713 (comment), uninstalling Watchman fixes the issue so it’s either a problem with Watchman, or its Jest integration on Sierra.

@gaearon

This comment has been minimized.

Show comment
Hide comment
@gaearon

gaearon Sep 23, 2016

Member

A few other possibly related threads:

ember-cli/ember-cli#6259
facebook/watchman#358

Can you try any suggestions there and report back?

Member

gaearon commented Sep 23, 2016

A few other possibly related threads:

ember-cli/ember-cli#6259
facebook/watchman#358

Can you try any suggestions there and report back?

@cpojer

This comment has been minimized.

Show comment
Hide comment
@cpojer

cpojer Sep 24, 2016

Contributor

@gaearon I'm using node 6.6.0 on Sierra with watchman and everything is fine.

Contributor

cpojer commented Sep 24, 2016

@gaearon I'm using node 6.6.0 on Sierra with watchman and everything is fine.

@cpojer

This comment has been minimized.

Show comment
Hide comment
@cpojer

cpojer Sep 24, 2016

Contributor

Definitely seems like a watchman/upgrading issue. I'm gonna close this out for now but happy to reopen in case this is actually a Jest problem. Since many people reported this on other projects (rn) it is unlikely though.

Contributor

cpojer commented Sep 24, 2016

Definitely seems like a watchman/upgrading issue. I'm gonna close this out for now but happy to reopen in case this is actually a Jest problem. Since many people reported this on other projects (rn) it is unlikely though.

@cpojer cpojer closed this Sep 24, 2016

@gnoff

This comment has been minimized.

Show comment
Hide comment
@gnoff

gnoff Sep 27, 2016

I do not believe I have ever had watchman installed and I just now am experiencing this issue with jest in watch mode. I also recently upgraded to macOS Sierra. My guess is watchman can help (and I will try it as a workaround) but I don't think the problem is native to having or using watchman

gnoff commented Sep 27, 2016

I do not believe I have ever had watchman installed and I just now am experiencing this issue with jest in watch mode. I also recently upgraded to macOS Sierra. My guess is watchman can help (and I will try it as a workaround) but I don't think the problem is native to having or using watchman

@bedeoverend

This comment has been minimized.

Show comment
Hide comment
@bedeoverend

bedeoverend Sep 27, 2016

FWIW I don't have watchman installed and still had this bug, but deleting my node_modules folder and reinstall did the trick for me

bedeoverend commented Sep 27, 2016

FWIW I don't have watchman installed and still had this bug, but deleting my node_modules folder and reinstall did the trick for me

@hmeerlo

This comment has been minimized.

Show comment
Hide comment
@hmeerlo

hmeerlo Sep 30, 2016

I think it is a bit short through the corner to close this issue. Jest reports an error, so maybe the problem is in one of the dependencies which need to be updated? I removed my node_modules and reinstalled, but to no avail. I never installed watchman and even if I did, the dependencies should be coming from my package.json, not from any external program I installed.

hmeerlo commented Sep 30, 2016

I think it is a bit short through the corner to close this issue. Jest reports an error, so maybe the problem is in one of the dependencies which need to be updated? I removed my node_modules and reinstalled, but to no avail. I never installed watchman and even if I did, the dependencies should be coming from my package.json, not from any external program I installed.

@cpojer

This comment has been minimized.

Show comment
Hide comment
@cpojer

cpojer Sep 30, 2016

Contributor

I was thinking that fsevents is the issue. I would recommend reinstalling the node binary, wiping away all node_modules folders and doing a fresh npm install.

Contributor

cpojer commented Sep 30, 2016

I was thinking that fsevents is the issue. I would recommend reinstalling the node binary, wiping away all node_modules folders and doing a fresh npm install.

@hmeerlo

This comment has been minimized.

Show comment
Hide comment
@hmeerlo

hmeerlo Sep 30, 2016

I installed new node binary (6.7.0), removed node_modules again, reinstalled everything but still the same error. But I guess the problem is that it is trying to watch too many files at once: http://stackoverflow.com/questions/8965606/node-and-error-emfile-too-many-open-files

hmeerlo commented Sep 30, 2016

I installed new node binary (6.7.0), removed node_modules again, reinstalled everything but still the same error. But I guess the problem is that it is trying to watch too many files at once: http://stackoverflow.com/questions/8965606/node-and-error-emfile-too-many-open-files

@robzolkos

This comment has been minimized.

Show comment
Hide comment
@robzolkos

robzolkos Sep 30, 2016

The folks over on react-native fixed the too many files at once issue I think here

However for me, it was still an upgrade of watchman that fixed it.

robzolkos commented Sep 30, 2016

The folks over on react-native fixed the too many files at once issue I think here

However for me, it was still an upgrade of watchman that fixed it.

@cpojer

This comment has been minimized.

Show comment
Hide comment
@cpojer

cpojer Sep 30, 2016

Contributor

Usually when this happens it is a sign to restart the computer. This happens frequently at FB too (unrelated to Jest) :(

Contributor

cpojer commented Sep 30, 2016

Usually when this happens it is a sign to restart the computer. This happens frequently at FB too (unrelated to Jest) :(

@hmeerlo

This comment has been minimized.

Show comment
Hide comment
@hmeerlo

hmeerlo Sep 30, 2016

Sorry to be such a pain in the *ss. I raised the ulimits as pointed out in the issue @robzolkos pointed at, but why would I need to install watchman? It is not a dependency of Jest, I just use Jest out of the box as is. This is my setup now:

14:31 $ ulimit -n
100000
14:31 $ node --version
v6.7.0
14:31 $ npm -v
3.10.3

The project contains about 45k files (including node_modules) so I don't see why it could still give me an EMFILE. I will check if installing watchman is a workaround.

hmeerlo commented Sep 30, 2016

Sorry to be such a pain in the *ss. I raised the ulimits as pointed out in the issue @robzolkos pointed at, but why would I need to install watchman? It is not a dependency of Jest, I just use Jest out of the box as is. This is my setup now:

14:31 $ ulimit -n
100000
14:31 $ node --version
v6.7.0
14:31 $ npm -v
3.10.3

The project contains about 45k files (including node_modules) so I don't see why it could still give me an EMFILE. I will check if installing watchman is a workaround.

@cpojer

This comment has been minimized.

Show comment
Hide comment
@cpojer

cpojer Sep 30, 2016

Contributor

@hmeerlo watchman is a file watching service built by FB to make file system operations faster. Jest will run much faster on a big repo if watchman is installed and it brings the startup overhead of Jest to practically nothing as it will only statically analyze files that have changed.

Contributor

cpojer commented Sep 30, 2016

@hmeerlo watchman is a file watching service built by FB to make file system operations faster. Jest will run much faster on a big repo if watchman is installed and it brings the startup overhead of Jest to practically nothing as it will only statically analyze files that have changed.

@hmeerlo

This comment has been minimized.

Show comment
Hide comment
@hmeerlo

hmeerlo Sep 30, 2016

Thanx, I just checked it and it works flawless now, but there still is another issue somewhere for people who do not have watchman installed, as it is not a requirement for jest.

hmeerlo commented Sep 30, 2016

Thanx, I just checked it and it works flawless now, but there still is another issue somewhere for people who do not have watchman installed, as it is not a requirement for jest.

@cpojer

This comment has been minimized.

Show comment
Hide comment
@cpojer

cpojer Sep 30, 2016

Contributor

It's not a strict requirement but just like react-native, on big repositories with large dependency trees (lots of node modules, for example), we do recommend watchman for better performance and to avoid the problems mentioned in this issue. I would recommend your team to install it to speed up common file system operations.

Contributor

cpojer commented Sep 30, 2016

It's not a strict requirement but just like react-native, on big repositories with large dependency trees (lots of node modules, for example), we do recommend watchman for better performance and to avoid the problems mentioned in this issue. I would recommend your team to install it to speed up common file system operations.

@gaearon

This comment has been minimized.

Show comment
Hide comment
@gaearon

gaearon Sep 30, 2016

Member

@cpojer Should we document Watchman in CRA User Guide?

Member

gaearon commented Sep 30, 2016

@cpojer Should we document Watchman in CRA User Guide?

@cpojer

This comment has been minimized.

Show comment
Hide comment
@cpojer

cpojer Sep 30, 2016

Contributor

@gaearon Yeah, I don't think there is any problem with that. I would recommend adding it to the Jest docs as well.

I'm unsure how big the dependency tree of cra's node_modules is. If it is sufficiently large we should probably recommend watchman to most people.

Contributor

cpojer commented Sep 30, 2016

@gaearon Yeah, I don't think there is any problem with that. I would recommend adding it to the Jest docs as well.

I'm unsure how big the dependency tree of cra's node_modules is. If it is sufficiently large we should probably recommend watchman to most people.

@bedeoverend

This comment has been minimized.

Show comment
Hide comment
@bedeoverend

bedeoverend Oct 4, 2016

FYI Even though reinstall all node_modules initially did the trick for me, seems it was temporary, borked again. But installing watchman resolved this for me.

+1 to documenting it in Jest as a recommended install.

bedeoverend commented Oct 4, 2016

FYI Even though reinstall all node_modules initially did the trick for me, seems it was temporary, borked again. But installing watchman resolved this for me.

+1 to documenting it in Jest as a recommended install.

@davidtheclark

This comment has been minimized.

Show comment
Hide comment
@davidtheclark

davidtheclark Oct 7, 2016

It's unclear what the outcome of this issue is. Just now I've freshly installed Jest (with fresh node_modules) on Sierra and run into this problem, which makes --watch unusable. Is that the resolution of this issue just that Jest's watch mode does not work on Sierra? Or it only works on Node 6 with Watchman?

davidtheclark commented Oct 7, 2016

It's unclear what the outcome of this issue is. Just now I've freshly installed Jest (with fresh node_modules) on Sierra and run into this problem, which makes --watch unusable. Is that the resolution of this issue just that Jest's watch mode does not work on Sierra? Or it only works on Node 6 with Watchman?

@gaearon

This comment has been minimized.

Show comment
Hide comment
@gaearon

gaearon Oct 8, 2016

Member

Do you have problems if you uninstall Watchman completely? Jets should use the Node based watcher if you do so. Do you have issues with it as well?

Member

gaearon commented Oct 8, 2016

Do you have problems if you uninstall Watchman completely? Jets should use the Node based watcher if you do so. Do you have issues with it as well?

@davidtheclark

This comment has been minimized.

Show comment
Hide comment
@davidtheclark

davidtheclark Oct 8, 2016

@gaearon I only got it to work by installing Watchman. Without Watchman, no luck.

davidtheclark commented Oct 8, 2016

@gaearon I only got it to work by installing Watchman. Without Watchman, no luck.

@Anahkiasen

This comment has been minimized.

Show comment
Hide comment
@Anahkiasen

Anahkiasen Oct 8, 2016

Same here, it's without watchman that it doesn't work for me

Anahkiasen commented Oct 8, 2016

Same here, it's without watchman that it doesn't work for me

@carl-altvr

This comment has been minimized.

Show comment
Hide comment
@carl-altvr

carl-altvr Oct 11, 2016

I was having this problem using node 4.6.0 after upgrading to Sierra. After upgrading node to v6.7.0, clearing node_modules and running a new npm install, jest watch started working again. I had to both upgrade node and then clear node_modules, though; those things individually didn't fix the problem.

carl-altvr commented Oct 11, 2016

I was having this problem using node 4.6.0 after upgrading to Sierra. After upgrading node to v6.7.0, clearing node_modules and running a new npm install, jest watch started working again. I had to both upgrade node and then clear node_modules, though; those things individually didn't fix the problem.

@yisding

This comment has been minimized.

Show comment
Hide comment
@yisding

yisding Oct 24, 2016

Mac OS Sierra (10.12.1). Node 6.7. If I don't install watchman, I get the error. Please reopen. This is a jest problem, and also creates problems when using create-react-app.

yisding commented Oct 24, 2016

Mac OS Sierra (10.12.1). Node 6.7. If I don't install watchman, I get the error. Please reopen. This is a jest problem, and also creates problems when using create-react-app.

@maxhallinan

This comment has been minimized.

Show comment
Hide comment
@maxhallinan

maxhallinan Aug 22, 2017

None of the above solutions worked while I was working inside a tmux session.
Steps to fix:

  • Exit tmux session
  • brew uninstall watchman
  • brew install watchman
  • yarn test
  • Enter tmux session
  • yarn test

node: 8.3.0
npm: 5.3.0
jest: 20.0.4
macOS Sierra: 10.12.6

maxhallinan commented Aug 22, 2017

None of the above solutions worked while I was working inside a tmux session.
Steps to fix:

  • Exit tmux session
  • brew uninstall watchman
  • brew install watchman
  • yarn test
  • Enter tmux session
  • yarn test

node: 8.3.0
npm: 5.3.0
jest: 20.0.4
macOS Sierra: 10.12.6

@maheshjag

This comment has been minimized.

Show comment
Hide comment
@maheshjag

maheshjag Dec 6, 2017

I've faced this issue off and on. I don't have Watchman installed, and I am on Node 8.4.0 currently. Removing and reinstalling Node modules didn't work either, so I reinstalled my Node binary from NVM and then removed and reinstalled Node modules which solved the problem for me.

maheshjag commented Dec 6, 2017

I've faced this issue off and on. I don't have Watchman installed, and I am on Node 8.4.0 currently. Removing and reinstalling Node modules didn't work either, so I reinstalled my Node binary from NVM and then removed and reinstalled Node modules which solved the problem for me.

@adrianhelvik

This comment has been minimized.

Show comment
Hide comment
@adrianhelvik

adrianhelvik Dec 7, 2017

I get this error with jest 21, but not with jest 20.

adrianhelvik commented Dec 7, 2017

I get this error with jest 21, but not with jest 20.

@dchambers

This comment has been minimized.

Show comment
Hide comment
@dchambers

dchambers Dec 18, 2017

I didn't have Watchman installed, but a brew install watchman fixed this for me.

dchambers commented Dec 18, 2017

I didn't have Watchman installed, but a brew install watchman fixed this for me.

@shellbryson

This comment has been minimized.

Show comment
Hide comment
@shellbryson

shellbryson Jan 5, 2018

Also didn't have Watchman installed & brew install watchman fixed. Bizarrely, everything was working until I installed Enzyme into my project, after which the problem appeared in twice before the test run aborted. Rolling the project back did not fix. I've had to document this work around, but I'm not understanding why it happened, or how to avoid it in the future (given homebrew isn't always an option).

Node: v6.9.5

shellbryson commented Jan 5, 2018

Also didn't have Watchman installed & brew install watchman fixed. Bizarrely, everything was working until I installed Enzyme into my project, after which the problem appeared in twice before the test run aborted. Rolling the project back did not fix. I've had to document this work around, but I'm not understanding why it happened, or how to avoid it in the future (given homebrew isn't always an option).

Node: v6.9.5

@BookOfGreg

This comment has been minimized.

Show comment
Hide comment
@BookOfGreg

BookOfGreg Jan 22, 2018

@dchambers I had the opposite issue:
I did a brew uninstall watchman and Jest started running!
See facebook/watchman/issues/20

BookOfGreg commented Jan 22, 2018

@dchambers I had the opposite issue:
I did a brew uninstall watchman and Jest started running!
See facebook/watchman/issues/20

@mhsjlw

This comment has been minimized.

Show comment
Hide comment
@mhsjlw

mhsjlw Feb 6, 2018

Incredibly strange, I was trying to figure this out, I uninstalled watchman using brew uninstall watchman like @BookOfGreg and it now works.

mhsjlw commented Feb 6, 2018

Incredibly strange, I was trying to figure this out, I uninstalled watchman using brew uninstall watchman like @BookOfGreg and it now works.

@CamJN

This comment has been minimized.

Show comment
Hide comment
@CamJN

CamJN Feb 12, 2018

This is still broken in High Sierra with a create-react-app generated app, node v9.5.0,
npm 5.6.0, and jest 18.1.0.

CamJN commented Feb 12, 2018

This is still broken in High Sierra with a create-react-app generated app, node v9.5.0,
npm 5.6.0, and jest 18.1.0.

@jaredwilli

This comment has been minimized.

Show comment
Hide comment
@jaredwilli

jaredwilli Mar 1, 2018

I had to install watchman, which is weird that everyone is saying they had to uninstall it.

I'm just happy it's working :)

jaredwilli commented Mar 1, 2018

I had to install watchman, which is weird that everyone is saying they had to uninstall it.

I'm just happy it's working :)

@adrianhelvik

This comment has been minimized.

Show comment
Hide comment
@adrianhelvik

adrianhelvik Mar 2, 2018

I once again had to downgrade Jest because of some cryptic error. Love Jest and downgrading worked. But I'm not getting the most recent version of Jest to play along in any way!

adrianhelvik commented Mar 2, 2018

I once again had to downgrade Jest because of some cryptic error. Love Jest and downgrading worked. But I'm not getting the most recent version of Jest to play along in any way!

@billfienberg

This comment has been minimized.

Show comment
Hide comment
@billfienberg

billfienberg Mar 10, 2018

#1767 (comment)

brew install watchman fixed it for me.

billfienberg commented Mar 10, 2018

#1767 (comment)

brew install watchman fixed it for me.

@russellf9

This comment has been minimized.

Show comment
Hide comment
@russellf9

russellf9 Mar 30, 2018

I was working on a simple React project created from Create React App.

I was simply trying to add some Jest tests running npm run test

Resulted in an error:

the owner of /usr/local/var/run/watchman/factornine-state is uid 0 and doesn't match your euid 501

Watchman:  watchman --no-pretty get-sockname returned with exit code=1, signal=null, stderr= 2018-03-25T14:38:11,538: [2754904896] the owner of /usr/local/var/run/watchman/factornine-state is uid 0 and doesn't match your euid 501

OSX - 10.13.3
Node - v6.13.0
NPM - 3.10.10
watchman 4.7.0

Project Enviroment
React 16.2.0
Jest 22.4.3

I tried brew upgrade watchman -> watchman 4.9.0 to no avail.

Setting the permissions on the /usr/local/var/run/watchman directory didn't work either.

This did though:

rm -rf node_modules/
npm update
brew uninstall watchman

npm run test ran without error!

russellf9 commented Mar 30, 2018

I was working on a simple React project created from Create React App.

I was simply trying to add some Jest tests running npm run test

Resulted in an error:

the owner of /usr/local/var/run/watchman/factornine-state is uid 0 and doesn't match your euid 501

Watchman:  watchman --no-pretty get-sockname returned with exit code=1, signal=null, stderr= 2018-03-25T14:38:11,538: [2754904896] the owner of /usr/local/var/run/watchman/factornine-state is uid 0 and doesn't match your euid 501

OSX - 10.13.3
Node - v6.13.0
NPM - 3.10.10
watchman 4.7.0

Project Enviroment
React 16.2.0
Jest 22.4.3

I tried brew upgrade watchman -> watchman 4.9.0 to no avail.

Setting the permissions on the /usr/local/var/run/watchman directory didn't work either.

This did though:

rm -rf node_modules/
npm update
brew uninstall watchman

npm run test ran without error!

@powah

This comment has been minimized.

Show comment
Hide comment
@powah

powah Apr 26, 2018

brew uninstall watchman helped me too! (node_modules reinstalling had no effect)
Env:
OSX - 10.13.3
Node - 8.11.1
npm - 5.8.0
watchman 4.9.0
Jest - 22.4.3

powah commented Apr 26, 2018

brew uninstall watchman helped me too! (node_modules reinstalling had no effect)
Env:
OSX - 10.13.3
Node - 8.11.1
npm - 5.8.0
watchman 4.9.0
Jest - 22.4.3

@stevenhadcroft

This comment has been minimized.

Show comment
Hide comment
@stevenhadcroft

stevenhadcroft May 10, 2018

I had exactly the same problem. $ brew install watchman worked perfectly for me aswell

stevenhadcroft commented May 10, 2018

I had exactly the same problem. $ brew install watchman worked perfectly for me aswell

@farhansyed77

This comment has been minimized.

Show comment
Hide comment
@farhansyed77

farhansyed77 May 22, 2018

brew install watchman or brew reinstall watchman or brew uninstall watchman did not work for me :(.

Whether the test succeeds or not, it just hangs after all tests are executed. Using --forceExit did not help.

node -v
v10.1.0
yarn -v
1.6.0
yarn jest --version
v21.2.1

farhansyed77 commented May 22, 2018

brew install watchman or brew reinstall watchman or brew uninstall watchman did not work for me :(.

Whether the test succeeds or not, it just hangs after all tests are executed. Using --forceExit did not help.

node -v
v10.1.0
yarn -v
1.6.0
yarn jest --version
v21.2.1

@mynameistechno

This comment has been minimized.

Show comment
Hide comment
@mynameistechno

mynameistechno 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.

Edit: upgrading to the alpha version of react-scripts (which upgrades jest) ultimately fixed this for me.

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.

Edit: upgrading to the alpha version of react-scripts (which upgrades jest) ultimately fixed this for me.

@releaf

This comment has been minimized.

Show comment
Hide comment
@releaf

releaf Jun 8, 2018

After adding Enzyme 3.3.0, this issue started for my team using an ejected version of CRA. We're all on High Sierra if that matters.
I explored all of the options outlined in the many links here and, aside from brew install watchman, nothing seemed to work. That was not an acceptable solution for me so I continued to investigate. Ultimately, updating to Jest 23.1.0 resolved the issue.

releaf commented Jun 8, 2018

After adding Enzyme 3.3.0, this issue started for my team using an ejected version of CRA. We're all on High Sierra if that matters.
I explored all of the options outlined in the many links here and, aside from brew install watchman, nothing seemed to work. That was not an acceptable solution for me so I continued to investigate. Ultimately, updating to Jest 23.1.0 resolved the issue.

@chrisbridges

This comment has been minimized.

Show comment
Hide comment
@chrisbridges

chrisbridges Jun 18, 2018

+1 more for installing Watchman. Don't like it, but it did work

chrisbridges commented Jun 18, 2018

+1 more for installing Watchman. Don't like it, but it did work

@mrdulin

This comment has been minimized.

Show comment
Hide comment
@mrdulin

mrdulin Jul 31, 2018

@robzolkos thanks. But I don't want to install watchman by myself

mrdulin commented Jul 31, 2018

@robzolkos thanks. But I don't want to install watchman by myself

@bdharrington7

This comment has been minimized.

Show comment
Hide comment
@bdharrington7

bdharrington7 Aug 15, 2018

I just ran into this myself, but what caused it was installing these packages in my CRA as dev dependencies:

    "enzyme": "^3.4.1",
    "enzyme-adapter-react-16": "^1.2.0",
    "react-test-renderer": "^16.4.2"

removing these dependencies fixed the issue.

node: 8.9.4 || 8.11.3
npm: 5.6.0

I didn't bother to install watchman with brew.

bdharrington7 commented Aug 15, 2018

I just ran into this myself, but what caused it was installing these packages in my CRA as dev dependencies:

    "enzyme": "^3.4.1",
    "enzyme-adapter-react-16": "^1.2.0",
    "react-test-renderer": "^16.4.2"

removing these dependencies fixed the issue.

node: 8.9.4 || 8.11.3
npm: 5.6.0

I didn't bother to install watchman with brew.

@Peripona

This comment has been minimized.

Show comment
Hide comment
@Peripona

Peripona Sep 17, 2018

How i fixes this was.

At first i tried brew install watchman and yes it worked like charm, However i was thinking if this could be the real issue? i again uninstalled it brew uninstall watchman

then i removed my node modules rm -rf node_modules and hit npm i again
also when i hit npm list --depth=0 I had Err of UNMET PEER DEPENDENCY jest@20.0.4
and then i moved jest from dependencies to devDependencies using npm i -D jest

in short

  1. rm -rf node_modules
  2. npm i
  3. npm i -D jest (if required)

might help someone. :)

Peripona commented Sep 17, 2018

How i fixes this was.

At first i tried brew install watchman and yes it worked like charm, However i was thinking if this could be the real issue? i again uninstalled it brew uninstall watchman

then i removed my node modules rm -rf node_modules and hit npm i again
also when i hit npm list --depth=0 I had Err of UNMET PEER DEPENDENCY jest@20.0.4
and then i moved jest from dependencies to devDependencies using npm i -D jest

in short

  1. rm -rf node_modules
  2. npm i
  3. npm i -D jest (if required)

might help someone. :)

@storrisi

This comment has been minimized.

Show comment
Hide comment
@storrisi

storrisi Oct 18, 2018

I was not using create-react-app, and i've solved removing the --watch option and using instead --no-watchman

storrisi commented Oct 18, 2018

I was not using create-react-app, and i've solved removing the --watch option and using instead --no-watchman

@mynameistechno

This comment has been minimized.

Show comment
Hide comment
@mynameistechno

mynameistechno Oct 18, 2018

Upgrading Jest (or react-scripts if you use cra) fixed it for me. React-scripts 2 went stable recently.

mynameistechno commented Oct 18, 2018

Upgrading Jest (or react-scripts if you use cra) fixed it for me. React-scripts 2 went stable recently.

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