Skip to content
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

Build doesn't work on an Ubuntu server #1133

Closed
vidarc opened this issue Dec 2, 2016 · 4 comments
Closed

Build doesn't work on an Ubuntu server #1133

vidarc opened this issue Dec 2, 2016 · 4 comments

Comments

@vidarc
Copy link

vidarc commented Dec 2, 2016

If you are reporting a bug, please fill in below. Otherwise feel free to remove this template entirely.

Can you reproduce the problem with latest npm?

Many errors, especially related to "missing modules", are due to npm bugs.

If you're using Windows, follow these instructions to update npm.

If you're using OS X or Linux, run this to update npm:

npm install -g npm@latest

cd your_project_directory
rm -rf node_modules
npm install

Then try to reproduce the issue again.

Can you still reproduce it?

Yes. I have tried installing and re-installing multiple times, using both npm and yarn to install the modules and to run the scripts.

Description

What are you reporting?

The build script runs, but it stops at some point. The build folder gets created and the favicon gets moved over to it, but nothing else appears to happen. The process takes about 13-15secs, while running build on my Macbook correctly builds and takes about 70secs.

Doing either yarn start or npm start works for the dev server.

Expected behavior

Tell us what you think should happen.

Actual behavior

Tell us what actually happens.

Environment

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

  1. npm ls react-scripts (if you haven’t ejected): react-scripts@0.7.0
  2. node -v: v.7.2.0
  3. npm -v: 4.0.2

Then, specify:

  1. Operating system: Ubuntu 16.04
  2. Browser and version:

Reproducible Demo

Please take the time to create a new app that reproduces the issue.

Alternatively, you could copy your app that experiences the problem and start removing things until you’re left with the minimal reproducible demo.

(Accidentally, you might get to the root of your problem during that process.)

Push to GitHub and paste the link here.

By doing this, you're helping the Create React App contributors a big time!
Demonstrable issues gets fixed faster.

@gaearon
Copy link
Contributor

gaearon commented Dec 2, 2016

I've seen reports about this which were resolved when the server was allocated more RAM. Can you check if this helps?

@godmar
Copy link

godmar commented Dec 3, 2016

If @gaearon 's suspicion is correct, then your build would have been killed by the OOM killer. You can verify this by looking into the kernel log via dmesg, as described in this SO post.
dmesg -T | tail -30 usually works.
If you see a message 'killed process' with 'node' in it, you know that's the reason.

This occurs when the OS optimistically overcommits virtual memory. It's particularly common in cloud environments that use SSD (and thus have no swap space configured).

@vidarc
Copy link
Author

vidarc commented Dec 3, 2016

Yep, that was the issue. 512 of RAM couldn't handle it. I added a swap file and it all works well now.

@godmar
Copy link

godmar commented Jan 21, 2019

Coming back to this issue 2 years later, glad to see PR #2060 accepted and finding actionable information in the docs. Crosslink to issue #1082 for future googlers.

Also, don't forget the 'dmesg -T' can confirm whether the OOM killer did it or not.

@lock lock bot locked and limited conversation to collaborators Jan 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants