Deploy details Deploy failed

9:10:53 AM: Netlify Build
9:10:53 AM: ────────────────────────────────────────────────────────────────
9:10:53 AM: ​
9:10:53 AM: ❯ Version
9:10:53 AM: @netlify/build 26.3.14
9:10:53 AM: ​
9:10:53 AM: ❯ Flags
9:10:53 AM: baseRelDir: true
9:10:53 AM: buildId: 622201875ce3dbb1569fa54f
9:10:53 AM: deployId: 622201875ce3dbb1569fa551
9:10:53 AM: ​
9:10:53 AM: ❯ Current directory
9:10:53 AM: /opt/build/repo
9:10:53 AM: ​
9:10:53 AM: ❯ Config file
9:10:53 AM: No config file was defined: using default values.
9:10:53 AM: ​
9:10:53 AM: ❯ Context
9:10:53 AM: production
9:10:53 AM: ​
9:10:53 AM: ────────────────────────────────────────────────────────────────
9:10:53 AM: 1. Build command from Netlify app
9:10:53 AM: ────────────────────────────────────────────────────────────────
9:10:53 AM: ​
9:10:53 AM: $ CI= npm run build
9:10:54 AM: > project-1@0.1.0 build
9:10:54 AM: > react-scripts build
9:10:55 AM: Could not find a required file.
9:10:55 AM: Name: index.html
9:10:55 AM: Searched in: /opt/build/repo/public
9:10:55 AM: ​
9:10:55 AM: ────────────────────────────────────────────────────────────────
9:10:55 AM: “build.command” failed
9:10:55 AM: ────────────────────────────────────────────────────────────────
9:10:55 AM: ​
9:10:55 AM: Error message
9:10:55 AM: Command failed with exit code 1: CI= npm run build
9:10:55 AM: ​
9:10:55 AM: Error location
9:10:55 AM: In Build command from Netlify app:
9:10:55 AM: CI= npm run build
9:10:55 AM: ​
9:10:55 AM: Resolved config
9:10:55 AM: build:
9:10:55 AM: command: CI= npm run build
9:10:55 AM: commandOrigin: ui
9:10:55 AM: environment:
9:10:55 AM: - CI
9:10:55 AM: publish: /opt/build/repo/build
9:10:55 AM: publishOrigin: ui
9:10:56 AM: Caching artifacts
9:10:56 AM: Started saving node modules
9:10:56 AM: Finished saving node modules
9:10:56 AM: Started saving build plugins
9:10:56 AM: Finished saving build plugins
9:10:56 AM: Started saving pip cache
9:10:56 AM: Finished saving pip cache
9:10:56 AM: Started saving emacs cask dependencies
9:10:56 AM: Finished saving emacs cask dependencies
9:10:56 AM: Started saving maven dependencies
9:10:56 AM: Finished saving maven dependencies
9:10:56 AM: Started saving boot dependencies
9:10:56 AM: Finished saving boot dependencies
9:10:56 AM: Started saving rust rustup cache
9:10:56 AM: Finished saving rust rustup cache
9:10:56 AM: Started saving go dependencies
9:10:56 AM: Finished saving go dependencies
9:10:57 AM: Build failed due to a user error: Build script returned non-zero exit code: 2
9:10:58 AM: Creating deploy upload records
9:10:58 AM: Failing build: Failed to build site
9:10:58 AM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2
9:10:59 AM: Finished processing build request in 50.156632757s

What should i do?

Hey @julianamewes

Based on the above lines from the log, there is no index.html in the public directory of the repository you are trying to deploy.

If you are able to share the repository, this could help diagnose the issue.

Here’s the repository:
https://github.com/julianamewes/cursoreact

Hiya, sorry you are having trouble with your build.

This Support Guide contains a ton of useful debugging tips that can likely help you solve your problem :slight_smile: Additionally, this Support Guide houses all of our resources for debugging build and deploy issues.

We also recommend trying to search the forums with the build error you encountered - it’s likely your question was already asked by someone else!

If you are still having problems, please provide as much information as you can on what you have already tried, what your build settings are, your package.json, etc. Thanks!

1 Like