Report this

What is the reason for this report?

I can't run "npm run build"

Posted on October 10, 2021

Hi there,

I have a very simple React app hosted in a droplet with these properties: 1 GB Memory / 25 GB Disk / NYC1 - Ubuntu 20.04 (LTS) x64

I’m trying to run a simple “npm run build” and it takes a lot of time, and I’m not able to complete the tasks.

What can be the problem? Should I pick a bigger droplet?

Thanks.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

In the past when I’ve encountered issues with npm, I like to do a force clear of the npm cache (npm cache clean --force) or run a rebuild (npm rebuild). Then after that, I’d run my script again.

This may or may not solve your problem, but the goal is to kind of reset your npm environment so you can start troubleshooting what the real problem could be (i.e. the node_modules, the build script, etc).

If you’re questioning the value of increasing the size of your droplet, you might want to assess how much processing power your app needs. If it’s just a simple React app, I wouldn’t imagine that it would need much more than what you’re using.

Have you found the solution? it looks like I’ve got the same issue :(

Heya, @sergiogregorutti

Have you added swap to the droplet? You can check this article here:

https://www.digitalocean.com/community/tutorial-collections/how-to-add-swap-space

Once the swap is added, give it another try.

Regards

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.