Netlify deployment not working giving this error regarding dependencies , I have used Material UI and React Js for this project

2:33:20 PM: npm ERR! Found: react@18.2.0

2:33:20 PM: npm ERR! node_modules/react

2:33:20 PM: npm ERR! react@β€œ^18.2.0” from the root project

2:33:20 PM: npm ERR! peer react@β€œ^18.0.0” from @testing-library/react@13.3.0

2:33:20 PM: npm ERR! node_modules/@testing-library/react

2:33:20 PM: Failed during stage β€˜building site’: Build script returned non-zero exit code: 1 (Search results for '"non-zero exit code: 1"' - Netlify Support Forums)

2:33:20 PM: npm ERR! @testing-library/react@β€œ^13.3.0” from the root project

2:33:20 PM: npm ERR! 3 more (react-dom, react-scripts, react-transition-group)

2:33:20 PM: npm ERR! 2:33:20 PM: npm ERR! Could not resolve dependency:

2:33:20 PM: npm ERR! peer react@β€œ^16.8.0 || ^17.0.0” from @material-ui/core@4.12.4

2:33:20 PM: npm ERR! node_modules/@material-ui/core

2:33:20 PM: npm ERR! @material-ui/core@β€œ^4.12.4” from the root project

2:33:20 PM: npm ERR! peer @material-ui/core@β€œ^4.0.0” from @material-ui/icons@4.11.3

2:33:20 PM: npm ERR! node_modules/@material-ui/icons

2:33:20 PM: npm ERR! @material-ui/icons@β€œ^4.11.3” from the root project

2:33:20 PM: npm ERR! 1 more (@material-ui/lab)

2:33:20 PM: npm ERR! 2:33:20 PM: npm ERR! Conflicting peer dependency: react@17.0.2

2:33:20 PM: npm ERR! node_modules/react

2:33:20 PM: npm ERR! peer react@β€œ^16.8.0 || ^17.0.0” from @material-ui/core@4.12.4

2:33:20 PM: npm ERR! node_modules/@material-ui/core

2:33:20 PM: npm ERR! @material-ui/core@β€œ^4.12.4” from the root project

2:33:20 PM: npm ERR! peer @material-ui/core@β€œ^4.0.0” from @material-ui/icons@4.11.3

2:33:20 PM: npm ERR! node_modules/@material-ui/icons

2:33:20 PM: npm ERR! @material-ui/icons@β€œ^4.11.3” from the root project

2:33:20 PM: npm ERR! 1 more (@material-ui/lab)

2:33:20 PM: npm ERR! 2:33:20 PM: npm ERR! Fix the upstream dependency conflict, or retry

2:33:20 PM: npm ERR! this command with --force, or --legacy-peer-deps

2:33:20 PM: npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

2:33:20 PM: npm ERR! 2:33:20 PM: npm ERR! See /opt/buildhome/.npm/eresolve-report.txt for a full report.

2:33:20 PM: npm ERR! A complete log of this run can be found in:

2:33:20 PM: npm ERR! /opt/buildhome/.npm/_logs/2022-08-01T09_03_18_638Z-debug-0.log

2:33:20 PM: Error during NPM install

2:33:20 PM: Build was terminated: Build script returned non-zero exit code: 1

2:33:20 PM: Failing build: Failed to build site

2:33:20 PM: Finished processing build request in 8.05661984s

Hi there, glad you found us :wave: before we can help you, we need a little more information on the issues you are facing.

First, have you looked through this resource? It is a compilation of all of our build and deploy resources. This is a good starting point.

If you have worked through those guides and are still encountering issues please share the following information:

  • the name of your build instance: β€œexample-jones.netlify.com”
  • what you have already tried
  • any error messages you have received in your terminal window or in the developer console