Gatsby Build Error

Oh, I just fixed it. I just got the answer from Stack Overflow at this link

Solution

We only need to add .npmrc file to the repository, write a line “legacy-peer-deps=true” and then commit it so the deployment will restart with that npm flag. I hope it helps whoever faces the same problem.