Question

I can't run "npm run build"

Posted October 10, 2021 95 views
NginxNode.jsRedisReact

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.

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.

×
Submit an Answer
1 answer

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.