Skip to content

Commit 117d82b

Browse files
GAumalagaearon
authored andcommitted
Add more info about OOM build failiure [docs] (#2060)
In the section about npm run build fails in troubleshooting added more info about memory usage of the build script and a link to a tutorial for adding more swap space as a viable solution.
1 parent 0ed6c8d commit 117d82b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

packages/react-scripts/template/README.md

+7-3
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ You can find the most recent version of this guide [here](https://github.com/fac
8484
- [Troubleshooting](#troubleshooting)
8585
- [`npm start` doesn’t detect changes](#npm-start-doesnt-detect-changes)
8686
- [`npm test` hangs on macOS Sierra](#npm-test-hangs-on-macos-sierra)
87-
- [`npm run build` silently fails](#npm-run-build-silently-fails)
87+
- [`npm run build` exits too early](#npm-run-build-exits-too-early)
8888
- [`npm run build` fails on Heroku](#npm-run-build-fails-on-heroku)
8989
- [Moment.js locales are missing](#momentjs-locales-are-missing)
9090
- [Something Missing?](#something-missing)
@@ -1905,9 +1905,13 @@ If this still doesn’t help, try running `launchctl unload -F ~/Library/LaunchA
19051905
19061906
There are also reports that *uninstalling* Watchman fixes the issue. So if nothing else helps, remove it from your system and try again.
19071907
1908-
### `npm run build` silently fails
1908+
### `npm run build` exits too early
19091909
1910-
It is reported that `npm run build` can fail on machines with no swap space, which is common in cloud environments. If [the symptoms are matching](https://github.com/facebookincubator/create-react-app/issues/1133#issuecomment-264612171), consider adding some swap space to the machine you’re building on, or build the project locally.
1910+
It is reported that `npm run build` can fail on machines with limited memory and no swap space, which is common in cloud environments. Even with small projects this command can increase RAM usage in your system by hundreds of megabytes, so if you have less than 1 GB of available memory your build is likely to fail with the following message:
1911+
1912+
> The build failed because the process exited too early. This probably means the system ran out of memory or someone called `kill -9` on the process.
1913+
1914+
If you are completely sure that you didn't terminate the process, consider [adding some swap space](https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04) to the machine you’re building on, or build the project locally.
19111915
19121916
### `npm run build` fails on Heroku
19131917

0 commit comments

Comments
 (0)