Hello, I’m facing this issue Build failed due to a user error: The build script returned non-zero exit code: 2. and I can’t deploy my React App, any suggestions would be great
10:29:11 AM: build-image version: 20e1f1f500e4cbad9ea8a99bd40807bef3093551 (focal)
10:29:11 AM: buildbot version: d7125d73ee51e5ae94a98ff24da5d2bcd8321340
10:29:11 AM: Fetching cached dependencies
10:29:11 AM: Failed to fetch cache, continuing with build
10:29:11 AM: Starting to prepare the repo for build
10:29:11 AM: git clone --filter=blob:none GitHub - lzajota/vanlife-app--react
10:29:11 AM: No cached dependencies found. Cloning fresh repo
10:29:12 AM: Preparing Git Reference refs/heads/main
10:29:13 AM: Starting to install dependencies
10:29:13 AM: Python version set to 3.8
10:29:13 AM: Attempting Ruby version 2.7.2, read from environment
10:29:14 AM: Using Ruby version 2.7.2
10:29:15 AM: Started restoring cached go cache
10:29:15 AM: Finished restoring cached go cache
10:29:16 AM: Installing Go version 1.19.12 (requested 1.19.x)
10:29:20 AM: go version go1.19.12 linux/amd64
10:29:21 AM: Using PHP version 8.0
10:29:22 AM: Downloading and installing node v18.17.1…
10:29:22 AM: Downloading https://nodejs.org/dist/v18.17.1/node-v18.17.1-linux-x64.tar.xz…
10:29:22 AM: Computing checksum with sha256sum
10:29:22 AM: Checksums matched!
10:29:24 AM: Now using node v18.17.1 (npm v9.6.7)
10:29:24 AM: Enabling Node.js Corepack
10:29:24 AM: Started restoring cached build plugins
10:29:24 AM: Finished restoring cached build plugins
10:29:24 AM: Started restoring cached corepack dependencies
10:29:24 AM: Finished restoring cached corepack dependencies
10:29:24 AM: No npm workspaces detected
10:29:24 AM: Started restoring cached node modules
10:29:24 AM: Finished restoring cached node modules
10:29:24 AM: Installing npm packages using npm version 9.6.7
10:29:30 AM: npm WARN deprecated w3c-hr-time@1.0.2: Use your platform’s native performance.now() and performance.timeOrigin.
npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: Array.prototype.sort() - JavaScript | MDN
10:29:30 AM: npm WARN deprecated sourcemap-codec@1.4.8: Please use @jridgewell/sourcemap-codec instead
10:29:30 AM: npm WARN deprecated rollup-plugin-terser@7.0.2: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-terser
10:29:31 AM: npm WARN deprecated workbox-cacheable-response@6.6.0: workbox-background-sync@6.6.0
10:29:32 AM: npm WARN deprecated uglify-es@3.3.9: support for ECMAScript is superseded by uglify-js
as of v3.13.0
10:29:32 AM: npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
10:29:43 AM: added 1959 packages, and audited 1960 packages in 18s
10:29:43 AM: 255 packages are looking for funding
10:29:43 AM: run npm fund
for details
10:29:43 AM: 6 high severity vulnerabilities
10:29:43 AM: To address all issues (including breaking changes), run:
10:29:43 AM: npm audit fix --force
10:29:43 AM: Run npm audit
for details.
10:29:43 AM: npm packages installed
10:29:43 AM: Install dependencies script success
10:29:43 AM: Starting build script
10:29:44 AM: Detected 1 framework(s)
10:29:44 AM: create-react-app at version 5.0.1
10:29:44 AM: Section completed: initializing
Building
Failed
10:30:02 AM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2 (Search results for '"non-zero exit code: 2"' - Netlify Support Forums)
10:29:45 AM: Netlify Build
10:29:45 AM: ────────────────────────────────────────────────────────────────
10:29:45 AM:
10:29:45 AM: ❯ Version
10:29:45 AM: @netlify/build 29.20.6
10:29:45 AM:
10:29:45 AM: ❯ Flags
10:29:45 AM: baseRelDir: true
10:29:45 AM: buildId: 64e1dce61956bc00098a1e98
10:29:45 AM: deployId: 64e1dce61956bc00098a1e9a
10:29:45 AM:
10:29:45 AM: ❯ Current directory
10:29:45 AM: /opt/build/repo
10:29:45 AM:
10:29:45 AM: ❯ Config file
10:29:45 AM: No config file was defined: using default values.
10:29:45 AM:
10:29:45 AM: ❯ Context
10:29:45 AM: production
10:29:45 AM:
10:29:45 AM: Build command from Netlify app
10:29:45 AM: ────────────────────────────────────────────────────────────────
10:29:45 AM:
10:29:45 AM: $ npm run build
10:29:46 AM: > vanlife-app@0.1.0 build
10:29:46 AM: > react-scripts build
10:29:47 AM: Creating an optimized production build…
10:29:50 AM: One of your dependencies, babel-preset-react-app, is importing the
10:29:50 AM: @babel/plugin-proposal-private-property-in-object package without
10:29:50 AM: declaring it in its dependencies. This is currently working because
10:29:50 AM: @babel/plugin-proposal-private-property-in-object is already in your
10:29:50 AM: node_modules folder for unrelated reasons, but it may break at any time.
10:29:50 AM: babel-preset-react-app is part of the create-react-app project, which
10:29:50 AM: is not maintianed anymore. It is thus unlikely that this bug will
10:29:50 AM: ever be fixed. Add @babel/plugin-proposal-private-property-in-object to
10:29:50 AM: your devDependencies to work around this error. This will make this message
10:29:50 AM: go away.
10:30:00 AM:
10:30:00 AM: Treating warnings as errors because process.env.CI = true.
10:30:00 AM: Most CI servers set it automatically.
10:30:00 AM:
10:30:00 AM: Failed to compile.
10:30:00 AM:
10:30:00 AM: [eslint]
10:30:00 AM: src/pages/Host/Dashboard.js
10:30:00 AM: Line 21:17: Redundant alt attribute. Screen-readers already announce img
tags as an image. You don’t need to use the words image
, photo,
or picture
(or any specified custom words) in the alt prop jsx-a11y/img-redundant-alt
10:30:00 AM: src/pages/Host/HostVans.js
10:30:00 AM: Line 32:17: Redundant alt attribute. Screen-readers already announce img
tags as an image. You don’t need to use the words image
, photo,
or picture
(or any specified custom words) in the alt prop jsx-a11y/img-redundant-alt
10:30:00 AM:
10:30:00 AM: build.command failed
10:30:00 AM: ────────────────────────────────────────────────────────────────
10:30:00 AM:
10:30:00 AM: Error message
10:30:00 AM: Command failed with exit code 1: npm run build (Search results for '"non-zero exit code: 1"' - Netlify Support Forums)
10:30:00 AM:
10:30:00 AM: Error location
10:30:00 AM: In Build command from Netlify app:
10:30:00 AM: npm run build
10:30:00 AM:
10:30:00 AM: Resolved config
10:30:00 AM: build:
10:30:00 AM: command: npm run build
10:30:00 AM: commandOrigin: ui
10:30:00 AM: publish: /opt/build/repo/build
10:30:00 AM: publishOrigin: ui
10:30:02 AM: Build failed due to a user error: Build script returned non-zero exit code: 2
10:30:02 AM: Failing build: Failed to build site
10:30:03 AM: Finished processing build request in 51.368s
Thank you