Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploying React app on Ubuntu 18.04: build failed because process exited too early

I'm trying to deploy my React app on an Ubuntu 18.04 virtual machine provided by Digital Ocean. Here's my process: I have a git repo linked to the correct directory so all I need to do is a git pull followed by a 'npm run build'. Up until now, this has worked well enough and I could check the site on [my_domain]:8080, which is sufficient for now since I'm still in production.

However, when I tried to run 'npm run build' yesterday, I got this error:

screenshot of terminal

I've looked it up a bit but there's so many different possibilities that it's just confusing me more. The most common issue seems to be a lack of memory on the system, but judging by the data I get when I start up the terminal, this can't be the case.

screenshot of terminal

I have no clue how to proceed but I've also honestly just been starting to use DigitalOcean or Ubuntu for half a year and this is my first React app, so I would very much appreciate an explanation like I'm five ;)

Thanks so much!

like image 899
Jesse Avatar asked Nov 15 '25 22:11

Jesse


1 Answers

The problem was apparently in the amount of RAM I had available. Solution: memory swapping. I followed this tutorial and after doing all this, the problem resolved itself.

https://www.digitalocean.com/community/tutorials/how-to-add-swap-space-on-ubuntu-18-04

like image 136
Jesse Avatar answered Nov 18 '25 21:11

Jesse



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!