Jest: `jest` commands hangs

Created on 23 Sep 2017  ·  8Comments  ·  Source: facebook/jest


Do you want to request a feature or report a bug?

Bug

What is the current behavior?

I just followed this guide: https://facebook.github.io/jest/docs/en/getting-started.html, but when I run jest, nothing happens, the terminal seem to hang/freeze.

image

If the current behavior is a bug, please provide the steps to reproduce and either a repl.it demo through https://repl.it/languages/jest or a minimal repository on GitHub that we can yarn install and yarn test.

Any repository will probably do, but for example:
https://repl.it/L6JH/0

What is the expected behavior?
The expected behaviour is that it won't freeze/hang, and that my tests are running.

Please provide your exact Jest configuration and mention your Jest, node, yarn/npm version and operating system.

jest version 21.1.0, but also tested at 20.0.4, 19.0.2, 13.2.3
node v8.5.0, but same at 7.5.0 and 6.5.0
tested on yarn 1.0.2, npm5 and npm4
macOS Siera 10.12.6

It is super strange, I just seem to come in an endless loop or something? Anything that I can do to give you guys more information?

Most helpful comment

Had to do a brew reinstall watchman before it would work.

All 8 comments

brew upgrade watchman fixed this for me

it seems like the reason it was hanging was because the command watchman version was hanging, and jest was executing that with execSync

Same problem here (watchman 4.9.0, the latest according to Homebrew) – fixed by brew uninstall watchman...

Had to do a brew reinstall watchman before it would work.

@blamh I love you ❤️

Had to force quite watchman then the test that was hanging immediately ran.

In my case (Which i think is rare) I fixed it by adding --forceExit flag

Upgrading, reintstalling and uninstallin watchman are all not working for me to fix my problem on macOS 10.15

But this fixed my problem

https://github.com/facebook/watchman/issues/358#issuecomment-247105934

I had the same problem on macos catalina. I don't know why but there is an error on system permissions and with sudo npm test it runs...
Screenshot 2020-09-08 at 09 01 36

Was this page helpful?
0 / 5 - 0 ratings