Create-react-app: npm test hangs for newly generated app

Created on 25 Oct 2016  ·  12Comments  ·  Source: facebook/create-react-app

Can you reproduce the problem with latest npm?

Yes.

Description

A newly generated app hangs indefinitely on npm test.

Expected behavior

The App.test.js file test should run.

Actual behavior

The test process hangs.

Environment

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

  1. npm ls react-scripts (if you haven’t ejected):
    [email protected] /Users/stephen/Developer/playground └── [email protected]
  2. node -v:
    v6.9.1
  3. npm -v:
    3.10.9

Then, specify:

  1. Operating system: macOS Sierra 10.12.1 (16B2555)
  2. Browser and version: n/a

Reproducible Demo

If need be I can attach a demo, though I assume I would need to recursively remove the .gitignores and commit the modules?

Steps to reproduce for me every time:

create-react-app playground
cd playground
npm test
bug underlying tools

Most helpful comment

Just chiming in for anyone running into this problem, I ran into this same issue. Uninstalling watchman fixed the problem, though installing watchman again reintroduced the problem. The underlying problem (for me atleast) is detailed in https://github.com/facebook/watchman/issues/358 and is related to corrupted state.

tl;dr try running launchctl unload ~/Library/LaunchAgents/com.github.facebook.watchman.plist, which should hopefully fix running tests (npm test) with watchman installed!

All 12 comments

Sorry you're having issues.
Do any suggestions in https://github.com/facebook/jest/issues/1767 help?

brew uninstall watchman did the trick. Should I file a bug there?

Just chiming in for anyone running into this problem, I ran into this same issue. Uninstalling watchman fixed the problem, though installing watchman again reintroduced the problem. The underlying problem (for me atleast) is detailed in https://github.com/facebook/watchman/issues/358 and is related to corrupted state.

tl;dr try running launchctl unload ~/Library/LaunchAgents/com.github.facebook.watchman.plist, which should hopefully fix running tests (npm test) with watchman installed!

Getting the same error, uninstalling then installing watchman with brew fixed the problem here.

launchctl unload ~/Library/LaunchAgents/com.github.facebook.watchman.plist fixed the problem for me

Hi guys I am experiencing this issue as well. Can i get some help on how to resolve this on windows 10?

Can you please file a new issue with a reproducing example? I don’t think the known issues were reproducible on Windows, so this might be a different problem.

Does create-react-app on OSX expect to have watchman installed? Should brew install watchman be documented as requirement in the readme.md?

This is going to be fixed with https://github.com/amasad/sane/pull/97.

For anyone having this problem on macOS, this is a workaround that allows you to run the tests once without the broken watcher:

CI=true npm test
or
CI=true yarn test
Was this page helpful?
0 / 5 - 0 ratings

Related issues

fson picture fson  ·  3Comments

barcher picture barcher  ·  3Comments

alleroux picture alleroux  ·  3Comments

DaveLindberg picture DaveLindberg  ·  3Comments

adrice727 picture adrice727  ·  3Comments