Can't understand why my Gatsby Build fails: Build script returned non-zero exit code: 2

HI @o.deangelis

I think we’re just looking at a difference in the available memory on the different environments. On your local machine, you have all of your local system’s resources for your build. I don’t know what resources are specifically assigned to a build on Gatsby Cloud but I think we can be pretty sure it’s not the same as Netlify. On Netlify, since you are on a starter account, you are guaranteed 8GBytes of memory and 4 CPUs.

If you want to know more about what resources are available to you based on your plan, check out this support guide:

And for our best tips on how to troubleshoot, check out that support guide I linked in my last post ( What can I do if my build fails for memory-overallocation-related errors? )

I hope this helps!