Skip to content

Commit

Permalink
Add a note for OSX users about watchman and jest (facebook#1080)
Browse files Browse the repository at this point in the history
* Add a note for OSX users about watchman and jest

Minor additional information on how to solve watchman problems reported in facebook#713 and facebook#1767

* Introduced new Troubleshooting section

Add better explanation how to solve facebook#713 and linked related Issues.

* Tweak wording and add it to TOC
  • Loading branch information
dmr authored and randycoulman committed May 8, 2017
1 parent 0d67d1a commit a43f722
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions packages/react-scripts/template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ You can find the most recent version of this guide [here](https://github.com/fac
- [Now](#now)
- [S3 and CloudFront](#s3-and-cloudfront)
- [Surge](#surge)
- [Troubleshooting](#troubleshooting)
- [Something Missing?](#something-missing)

## Updating to New Releases
Expand Down Expand Up @@ -1064,6 +1065,32 @@ Install the Surge CLI if you haven't already by running `npm install -g surge`.
Note that in order to support routers that use HTML5 `pushState` API, you may want to rename the `index.html` in your build folder to `200.html` before deploying to Surge. This [ensures that every URL falls back to that file](https://surge.sh/help/adding-a-200-page-for-client-side-routing).
## Troubleshooting
### `npm test` hangs on macOS Sierra
If you run `npm test` and the console gets stuck after printing `react-scripts test --env=jsdom` to the console there might be a problem with your [Watchman](https://facebook.github.io/watchman/) installation as described in [facebookincubator/create-react-app#713](https://github.com/facebookincubator/create-react-app/issues/713).
We recommend deleting `node_modules` in your project and running `npm install` (or `yarn` if you use it) first. If it doesn't help, you can try one of the numerous workarounds mentioned in these issues:
* [facebook/jest#1767](https://github.com/facebook/jest/issues/1767)
* [facebook/watchman#358](https://github.com/facebook/watchman/issues/358)
* [ember-cli/ember-cli#6259](https://github.com/ember-cli/ember-cli/issues/6259)
It is reported that installing Watchman 4.7.0 or newer fixes the issue. If you use [Homebrew](http://brew.sh/), you can run these commands to update it:
```
watchman shutdown-server
brew update
brew reinstall watchman
```
You can find [other installation methods](https://facebook.github.io/watchman/docs/install.html#build-install) on the Watchman documentation page.
If this still doesn't help, try running `launchctl unload -F ~/Library/LaunchAgents/com.github.facebook.watchman.plist`.
There are also reports that *uninstalling* Watchman fixes the issue. So if nothing else helps, remove it from your system and try again.
## Something Missing?
If you have ideas for more “How To” recipes that should be on this page, [let us know](https://github.com/facebookincubator/create-react-app/issues) or [contribute some!](https://github.com/facebookincubator/create-react-app/edit/master/packages/react-scripts/template/README.md)

0 comments on commit a43f722

Please sign in to comment.