Our advice for all build errors is get the build working locally. That’ll be your first step in troubleshooting, so get that configured and let us know if it works any better! I doubt it will, but then you can tell us for instance what files exist in your build when it fails, so we can potentially better advise you.
This article is a good place to start overall on build debugging, and you’ll notice that step one is get builds working locally as Netlify is not magic and won’t fix code errors for you