Deploy failed today: Build was terminated: Build script returned non-zero exit code: 1

The error is a peer dependency conflict relating to versions of react, which provides guidance on how you can attempt to resolve it:

11:06:39 AM: npm ERR! Fix the upstream dependency conflict, or retry
11:06:39 AM: npm ERR! this command with --force, or --legacy-peer-deps
11:06:39 AM: npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

It suggests you can run npm install --force or npm install --legacy-peer-deps.

To do this on Netlify you can use the NPM_FLAGS environment variable.

NPM_FLAGS: used to indicate the flags to pass to the npm install command.

Setting it to either --force or --legacy-peer-deps depending on your preference.

5 Likes
React Project causing npm ERR! code ERESOLVE while netlify deployment from github, where as build successfully on my localhost
Deploy failed NPM
Deploying problem
Build script returned non-zero exit code: 2 - I added logos and broke it
Error while resolving: react-lottie@1.2.3 Found: react@18.2.0
Failed during stage 'Install dependencies': dependency_installation script returned non-zero exit code
Gatsby 5 upgrade error
Netlify is failing to build the React Js Site
Build works locally but deploy fails when pushed to github
Unable to deploy my react app
Deploy failed to Publish website
Error on deployment
I am facing the error on deployment
Can't deploy next.js site
My react application is not showing up
I am facing build error while deploying the project
I am facing build error while deploying the project
Sanity Portfolio Starter build fails without clearing cache
Build script returned non-zero exit code: 1
Conflicting peer dependency it builds fine locally but i don't know what to do now ? especially that i'm trying to deploy a three js web app which works fine on desktop but the images doesn't render and crash on mobile for some reason
Error at deployment of a nextjs application
Conflicting peer dependency it builds fine locally but i don't know what to do now ? especially that i'm trying to deploy a three js web app which works fine on desktop but the images doesn't render and crash on mobile for some reason
Estou com problemas para fazer deploy por conflito de alguma coisa
Initializing error, the files run perfectly in the local system, but Netlify is not able to run them
Fail to Deploying a react project from GitHub
Gatsby-plugin-react-i18next is not compatible with your gatsby version 5.12.3
Sanity Portfolio Starter build fails without clearing cache
Build fails on Gatsby & Sanity site deploy with error for invalid lock file
Deploy fails on node-gyp-build command (migration from gatsby to netlify)
How to solve this error my website deployment?
Gatsby Build fail
Deploy versions problem vite and vuetify
How to modify the behavior of the initializing step? Like preventing `npm install`
Conflicting peer dependency: @types/react@17.0.50
Problems with deploy
Building Falied
The build process fails
Spline iframe in Vue.js portfolio not deploying