Support Forums

Deploy failed-Error: ENOENT: no such file or directory, open '/opt/build/repo/src/index.js'

Hi, i am trying to deploy my react portfolio website built with Gatsby with GoDaddy domain https://www.ivanadokic.com/ but deploy failed. Default subdomain

12:26:51 AM: Failed to compile.
12:26:51 AM:
12:26:51 AM: ./src/index.js
12:26:51 AM: Error: ENOENT: no such file or directory, open ‘/opt/build/repo/src/index.js’

hi ivana, it means that that file for some reason can’t be found.

Does this work locally?

If yes, it is maybe a case issue?

Hi, it works perfectly fine locally.

hi there,

i’m a little stuck on this one - clearly for some reason we seem to be looking for a file that isn’t there. Have you been able to make any progress on this? Did you check to see if it might be a case issue?

Hi, it’s all good and deployed.
I changed build command to yarn build instead of npm start.

Thank you,

1 Like