Build failed on Netlify but it works on local

site name. : cocheselectricosonline

cocheselectricosonline.netlify.app

On June 1, I deployed without problem like always and on June 3, I deployed again with minor changes and got this error.

9:48:43 AM: Build ready to start
9:48:48 AM: build-image version: d2c6dbeac570350a387d832f64bc980dc964ad65 (focal)
9:48:48 AM: build-image tag: v4.8.0
9:48:48 AM: buildbot version: 4aaa27647e859c2d38cfbb25901ceae1e7f3eeae
9:48:49 AM: Fetching cached dependencies
9:48:49 AM: Failed to fetch cache, continuing with build
9:48:49 AM: Starting to prepare the repo for build
9:48:49 AM: No cached dependencies found. Cloning fresh repo
9:48:49 AM: git clone https://github.com/dptoinformatica5/Nextjs_cocheselectricosonline
9:48:52 AM: Preparing Git Reference refs/heads/master
9:48:52 AM: Parsing package.json dependencies
9:48:54 AM: Starting build script
9:48:54 AM: Installing dependencies
9:48:54 AM: Python version set to 2.7
9:48:54 AM: Downloading and installing node v16.15.1...
9:48:55 AM: Downloading https://nodejs.org/dist/v16.15.1/node-v16.15.1-linux-x64.tar.xz...
9:48:55 AM: Computing checksum with sha256sum
9:48:55 AM: Checksums matched!
9:48:58 AM: Now using node v16.15.1 (npm v8.11.0)
9:48:58 AM: Started restoring cached build plugins
9:48:58 AM: Finished restoring cached build plugins
9:48:58 AM: Attempting ruby version 2.7.2, read from environment
9:49:00 AM: Using ruby version 2.7.2
9:49:00 AM: Using PHP version 8.0
9:49:00 AM: No npm workspaces detected
9:49:00 AM: Started restoring cached node modules
9:49:00 AM: Finished restoring cached node modules
9:49:01 AM: Installing NPM modules using NPM version 8.11.0
9:49:01 AM: npm WARN config tmp This setting is no longer used.  npm stores temporary files in a special
9:49:01 AM: npm WARN config location in the cache, and they are managed by
9:49:01 AM: npm WARN config     [`cacache`](http://npm.im/cacache).
9:49:01 AM: npm WARN config tmp This setting is no longer used.  npm stores temporary files in a special
9:49:01 AM: npm WARN config location in the cache, and they are managed by
9:49:01 AM: npm WARN config     [`cacache`](http://npm.im/cacache).
9:49:09 AM: npm ERR! code ERESOLVE
9:49:09 AM: npm ERR! ERESOLVE could not resolve
9:49:09 AM: npm ERR!
9:49:09 AM: npm ERR! While resolving: rodal@1.8.1
9:49:09 AM: Creating deploy upload records
9:49:09 AM: npm ERR! Found: react@17.0.2
9:49:09 AM: npm ERR! node_modules/react
9:49:09 AM: npm ERR!   react@"17.0.2" from the root project
9:49:09 AM: npm ERR!   peer react@">=16.x" from @fortawesome/react-fontawesome@0.1.15
9:49:09 AM: npm ERR!   node_modules/@fortawesome/react-fontawesome
9:49:09 AM: npm ERR!     @fortawesome/react-fontawesome@"^0.1.15" from the root project
9:49:09 AM: npm ERR!   33 more (@next/react-dev-overlay, @react-aria/ssr, ...)
9:49:09 AM: Failed during stage 'building site': Build script returned non-zero exit code: 1 (https://ntl.fyi/exit-code-1)
9:49:09 AM: npm ERR!
9:49:09 AM: npm ERR! Could not resolve dependency:
9:49:09 AM: npm ERR! peer react@"^16.0.0" from rodal@1.8.1
9:49:09 AM: npm ERR! node_modules/rodal
9:49:09 AM: npm ERR!   rodal@"^1.8.1" from the root project
9:49:09 AM: npm ERR!
9:49:09 AM: npm ERR! Conflicting peer dependency: react@16.14.0
9:49:09 AM: npm ERR! node_modules/react
9:49:09 AM: npm ERR!   peer react@"^16.0.0" from rodal@1.8.1
9:49:09 AM: npm ERR!   node_modules/rodal
9:49:09 AM: npm ERR!     rodal@"^1.8.1" from the root project
9:49:09 AM: npm ERR!
9:49:09 AM: npm ERR! Fix the upstream dependency conflict, or retry
9:49:09 AM: npm ERR! this command with --force, or --legacy-peer-deps
9:49:09 AM: npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
9:49:09 AM: npm ERR!
9:49:09 AM: npm ERR! See /opt/buildhome/.npm/eresolve-report.txt for a full report.
9:49:09 AM: npm ERR! A complete log of this run can be found in:
9:49:09 AM: npm ERR!     /opt/buildhome/.npm/_logs/2022-06-06T08_49_01_826Z-debug-0.log
9:49:09 AM: Error during NPM install
9:49:09 AM: Build was terminated: Build script returned non-zero exit code: 1
9:49:09 AM: Failing build: Failed to build site
9:49:10 AM: Finished processing build request in 21.254640467s

@diego-ceo Please see this thread:

You’ve got same issue, probably the same cause, and can use the same solutions.

2 Likes