I am trying to deploy my React site and it fails to build giving me an exit code of 1 but before that an exit code of 2.
My build log is as follows:
10:57:24 PM: "build.command" failed
10:57:24 PM: ────────────────────────────────────────────────────────────────
10:57:24 PM:
10:57:24 PM: Error message
10:57:24 PM: Command failed with exit code 1: react-scripts build (https://ntl.fyi/exit-code-1)
10:57:24 PM:
10:57:24 PM: Error location
10:57:24 PM: In Build command from Netlify app:
10:57:24 PM: react-scripts build
10:57:24 PM:
10:57:24 PM: Resolved config
10:57:24 PM: build:
10:57:24 PM: base: /opt/build/repo/client
10:57:24 PM: command: react-scripts build
10:57:24 PM: commandOrigin: ui
10:57:24 PM: environment:
10:57:24 PM: - NODE_VERSION
10:57:24 PM: - NPM_FLAGS
10:57:24 PM: publish: /opt/build/repo/client
10:57:24 PM: publishOrigin: default
10:57:24 PM: Caching artifacts
10:57:24 PM: Started saving node modules
10:57:24 PM: Finished saving node modules
10:57:24 PM: Started saving build plugins
10:57:24 PM: Finished saving build plugins
10:57:24 PM: Started saving pip cache
10:57:24 PM: Finished saving pip cache
10:57:24 PM: Started saving emacs cask dependencies
10:57:24 PM: Finished saving emacs cask dependencies
10:57:24 PM: Started saving maven dependencies
10:57:24 PM: Finished saving maven dependencies
10:57:24 PM: Started saving boot dependencies
10:57:24 PM: Finished saving boot dependencies
10:57:24 PM: Started saving rust rustup cache
10:57:24 PM: Finished saving rust rustup cache
10:57:24 PM: Started saving go dependencies
10:57:24 PM: Finished saving go dependencies
10:57:25 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
10:57:25 PM: Failing build: Failed to build site
10:57:25 PM: Finished processing build request in 1m13.677s
My build settings:
My site ID: https://peaceful-mermaid-8e32a8.netlify.app/