I am facing the error on deployment

  • 9:52:14 AM: Build ready to start
    9:52:17 AM: build-image version: d7b3dbfb0846505993c9a131894d1858074c90b4 (focal)
    9:52:17 AM: build-image tag: v4.10.1
    9:52:17 AM: buildbot version: fe73f8149ecfb48a56018180267e65cf6d92c423
    9:52:17 AM: Building without cache
    9:52:17 AM: Starting to prepare the repo for build
    9:52:17 AM: No cached dependencies found. Cloning fresh repo
    9:52:17 AM: git clone GitHub - NikhilMasurkar/NeeKeep-Task-Stock
    9:52:17 AM: Preparing Git Reference refs/heads/main
    9:52:17 AM: Parsing package.json dependencies
    9:52:18 AM: Starting build script
    9:52:18 AM: Installing dependencies
    9:52:18 AM: Python version set to 2.7
    9:52:19 AM: v16.16.0 is already installed.
    9:52:19 AM: Now using node v16.16.0 (npm v8.11.0)
    9:52:19 AM: Started restoring cached build plugins
    9:52:19 AM: Finished restoring cached build plugins
    9:52:19 AM: Attempting ruby version 2.7.2, read from environment
    9:52:20 AM: Using ruby version 2.7.2
    9:52:20 AM: Using PHP version 8.0
    9:52:20 AM: No npm workspaces detected
    9:52:20 AM: Started restoring cached node modules
    9:52:20 AM: Finished restoring cached node modules
    9:52:20 AM: Installing NPM modules using NPM version 8.11.0
    9:52:21 AM: npm WARN config tmp This setting is no longer used. npm stores temporary files in a special
    9:52:21 AM: npm WARN config location in the cache, and they are managed by
    9:52:21 AM: npm WARN config cacache.
    9:52:21 AM: npm WARN config tmp This setting is no longer used. npm stores temporary files in a special
    9:52:21 AM: npm WARN config location in the cache, and they are managed by
    9:52:21 AM: npm WARN config cacache.
    9:52:22 AM: npm ERR! code ERESOLVE
    9:52:22 AM: npm ERR! ERESOLVE could not resolve
    9:52:22 AM: npm ERR!
    9:52:22 AM: Creating deploy upload records
    9:52:22 AM: npm ERR! While resolving: @material-ui/core@4.12.4
    9:52:22 AM: npm ERR! Found: react@18.0.0
    9:52:22 AM: npm ERR! node_modules/react
    9:52:22 AM: npm ERR! react@“^18.0.0” from the root project
    9:52:22 AM: npm ERR! peer react@“*” from @testing-library/react@12.1.4
    9:52:22 AM: Failed during stage ‘building site’: Build script returned non-zero exit code: 1 (Search results for '"non-zero exit code: 1"' - Netlify Support Forums)
    9:52:22 AM: npm ERR! node_modules/@testing-library/react
    9:52:22 AM: npm ERR! @testing-library/react@“^12.1.4” from the root project
    9:52:22 AM: npm ERR! 5 more (react-dom, react-popper, react-scripts, …)
    9:52:22 AM: npm ERR!
    9:52:22 AM: npm ERR! Could not resolve dependency:
    9:52:22 AM: npm ERR! peer react@“^16.8.0 || ^17.0.0” from @material-ui/core@4.12.4
    9:52:22 AM: npm ERR! node_modules/@material-ui/core
    9:52:22 AM: npm ERR! @material-ui/core@“^4.12.4” from the root project
    9:52:22 AM: npm ERR! peer @material-ui/core@“^4.0.0” from @material-ui/icons@4.11.3
    9:52:22 AM: npm ERR! node_modules/@material-ui/icons
    9:52:22 AM: npm ERR! @material-ui/icons@“^4.11.3” from the root project
    9:52:22 AM: npm ERR!
    9:52:22 AM: npm ERR! Conflicting peer dependency: react@17.0.2
    9:52:22 AM: npm ERR! node_modules/react
    9:52:22 AM: npm ERR! peer react@“^16.8.0 || ^17.0.0” from @material-ui/core@4.12.4
    9:52:22 AM: npm ERR! node_modules/@material-ui/core
    9:52:22 AM: npm ERR! @material-ui/core@“^4.12.4” from the root project
    9:52:22 AM: npm ERR! peer @material-ui/core@“^4.0.0” from @material-ui/icons@4.11.3
    9:52:22 AM: npm ERR! node_modules/@material-ui/icons
    9:52:22 AM: npm ERR! @material-ui/icons@“^4.11.3” from the root project
    9:52:22 AM: npm ERR!
    9:52:22 AM: npm ERR! Fix the upstream dependency conflict, or retry
    9:52:22 AM: npm ERR! this command with --force, or --legacy-peer-deps
    9:52:22 AM: npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
    9:52:22 AM: npm ERR!
    9:52:22 AM: npm ERR! See /opt/buildhome/.npm/eresolve-report.txt for a full report.
    9:52:22 AM: npm ERR! A complete log of this run can be found in:
    9:52:22 AM: npm ERR! /opt/buildhome/.npm/_logs/2022-08-12T04_22_21_199Z-debug-0.log
    9:52:22 AM: Error during NPM install
    9:52:22 AM: Build was terminated: Build script returned non-zero exit code: 1
    9:52:22 AM: Failing build: Failed to build site
    9:52:22 AM: Finished processing build request in 5.332199718s

@Nikhilmasurkar See this answer: