Question

I can't run "npm run build"

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.


Submit an answer

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!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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.