9:16:41 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)
9:16:25 AM: Netlify Build
9:16:25 AM: ────────────────────────────────────────────────────────────────
9:16:25 AM:
9:16:25 AM: ❯ Version
9:16:25 AM: @netlify/build 29.15.3
9:16:25 AM:
9:16:25 AM: ❯ Flags
9:16:25 AM: baseRelDir: true
9:16:25 AM: buildId: 64ab7efa9a13930e04419933
9:16:25 AM: deployId: 64ab7efa9a13930e04419935
9:16:25 AM:
9:16:25 AM: ❯ Current directory
9:16:25 AM: /opt/build/repo
9:16:25 AM:
9:16:25 AM: ❯ Config file
9:16:25 AM: No config file was defined: using default values.
9:16:25 AM:
9:16:25 AM: ❯ Context
9:16:25 AM: production
9:16:25 AM:
9:16:25 AM: Build command from Netlify app
9:16:25 AM: ────────────────────────────────────────────────────────────────
9:16:25 AM:
9:16:25 AM: $ npm run build
9:16:26 AM: > ecommerce-app@0.1.0 build
9:16:26 AM: > react-scripts build
9:16:27 AM: Creating an optimized production build…
9:16:30 AM: One of your dependencies, babel-preset-react-app, is importing the
9:16:30 AM: @babel/plugin-proposal-private-property-in-object package without
9:16:30 AM: declaring it in its dependencies. This is currently working because
9:16:30 AM: @babel/plugin-proposal-private-property-in-object is already in your
9:16:30 AM: node_modules folder for unrelated reasons, but it may break at any time.
9:16:30 AM: babel-preset-react-app is part of the create-react-app project, which
9:16:30 AM: is not maintianed anymore. It is thus unlikely that this bug will
9:16:30 AM: ever be fixed. Add @babel/plugin-proposal-private-property-in-object to
9:16:30 AM: your devDependencies to work around this error. This will make this message
9:16:30 AM: go away.
9:16:40 AM:
9:16:40 AM: Treating warnings as errors because process.env.CI = true.
9:16:40 AM: Most CI servers set it automatically.
9:16:40 AM:
9:16:40 AM: Failed to compile.
9:16:40 AM:
9:16:40 AM: [eslint]
9:16:40 AM: src/pages/Cart.js
9:16:40 AM: Line 27:19: 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
9:16:40 AM: Line 74:19: 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
9:16:40 AM: src/pages/Contact.js
9:16:40 AM: Line 19:15:
@sathwikvintha2004 As it says:
9:16:40 AM: Treating warnings as errors because process.env.CI = true.
9:16:40 AM: Most CI servers set it automatically.
By default warnings are treated as errors, and errors cause your build to fail.
If you want warnings to be ignored you need to ensure the CI
value is false
.
The easiest way to do this will be to change your Build command from npm run build
to CI= npm run build
So what exactly should i do
I m bit confused proceeding further
@sathwikvintha2004 I’ve already answered that question.
change your Build command from
npm run build
toCI= npm run build