React Project causing npm ERR! code ERESOLVE while netlify deployment from github, where as build successfully on my localhost

I am trying to deploy my react app from Github auto-publishing but it causing an error

4:54:28 AM: npm ERR! ERESOLVE could not resolve
4:54:28 AM: npm ERR!
4:54:28 AM: npm ERR! While resolving: react-component-countdown-timer@0.1.8 

I’ve also tried CI=false and retry and clean cache as well but noting works out

a complete log is here

4:54:15 AM: Build ready to start
4:54:17 AM: build-image version: d2c6dbeac570350a387d832f64bc980dc964ad65 (focal)
4:54:17 AM: build-image tag: v4.8.0
4:54:17 AM: buildbot version: 4aaa27647e859c2d38cfbb25901ceae1e7f3eeae
4:54:18 AM: Fetching cached dependencies
4:54:18 AM: Failed to fetch cache, continuing with build
4:54:18 AM: Starting to prepare the repo for build
4:54:18 AM: No cached dependencies found. Cloning fresh repo
4:54:18 AM: git clone https://github.com/NaimaGhulamMuhammad/alphaOctopus
4:54:19 AM: Preparing Git Reference refs/heads/main
4:54:20 AM: Parsing package.json dependencies
4:54:21 AM: Starting build script
4:54:21 AM: Installing dependencies
4:54:21 AM: Python version set to 2.7
4:54:21 AM: Downloading and installing node v16.15.1...
4:54:21 AM: Downloading https://nodejs.org/dist/v16.15.1/node-v16.15.1-linux-x64.tar.xz...
4:54:22 AM: Computing checksum with sha256sum
4:54:22 AM: Checksums matched!
4:54:24 AM: Now using node v16.15.1 (npm v8.11.0)
4:54:24 AM: Started restoring cached build plugins
4:54:24 AM: Finished restoring cached build plugins
4:54:24 AM: Attempting ruby version 2.7.2, read from environment
4:54:25 AM: Using ruby version 2.7.2
4:54:26 AM: Using PHP version 8.0
4:54:26 AM: No npm workspaces detected
4:54:26 AM: Started restoring cached node modules
4:54:26 AM: Finished restoring cached node modules
4:54:26 AM: Installing NPM modules using NPM version 8.11.0
4:54:26 AM: npm WARN config tmp This setting is no longer used.  npm stores temporary files in a special
4:54:26 AM: npm WARN config location in the cache, and they are managed by
4:54:26 AM: npm WARN config     [`cacache`](http://npm.im/cacache).
4:54:27 AM: npm WARN config tmp This setting is no longer used.  npm stores temporary files in a special
4:54:27 AM: npm WARN config location in the cache, and they are managed by
4:54:27 AM: npm WARN config     [`cacache`](http://npm.im/cacache).
4:54:28 AM: npm ERR! code ERESOLVE
4:54:28 AM: npm ERR! ERESOLVE could not resolve
4:54:28 AM: npm ERR!
4:54:28 AM: npm ERR! While resolving: react-component-countdown-timer@0.1.8
4:54:28 AM: Creating deploy upload records
4:54:28 AM: npm ERR! Found: react@18.1.0
4:54:28 AM: npm ERR! node_modules/react
4:54:28 AM: npm ERR!   react@"^18.1.0" from the root project
4:54:28 AM: npm ERR!   peer react@"^18.0.0" from @testing-library/react@13.1.1
4:54:28 AM: npm ERR!   node_modules/@testing-library/react
4:54:28 AM: npm ERR!     @testing-library/react@"^13.1.1" from the root project
4:54:28 AM: Failed during stage 'building site': Build script returned non-zero exit code: 1 (https://ntl.fyi/exit-code-1)
4:54:28 AM: npm ERR!   11 more (react-accessible-accordion, react-countup, react-dom, ...)
4:54:28 AM: npm ERR!
4:54:28 AM: npm ERR! Could not resolve dependency:
4:54:28 AM: npm ERR! peer react@"^15.3.0 || ^16.2.0" from react-component-countdown-timer@0.1.8
4:54:28 AM: npm ERR! node_modules/react-component-countdown-timer
4:54:28 AM: npm ERR!   react-component-countdown-timer@"^0.1.8" from the root project
4:54:28 AM: npm ERR!
4:54:28 AM: npm ERR! Conflicting peer dependency: react@16.14.0
4:54:28 AM: npm ERR! node_modules/react
4:54:28 AM: npm ERR!   peer react@"^15.3.0 || ^16.2.0" from react-component-countdown-timer@0.1.8
4:54:28 AM: npm ERR!   node_modules/react-component-countdown-timer
4:54:28 AM: npm ERR!     react-component-countdown-timer@"^0.1.8" from the root project
4:54:28 AM: npm ERR!
4:54:28 AM: npm ERR! Fix the upstream dependency conflict, or retry
4:54:28 AM: npm ERR! this command with --force, or --legacy-peer-deps
4:54:28 AM: npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
4:54:28 AM: npm ERR!
4:54:28 AM: npm ERR! See /opt/buildhome/.npm/eresolve-report.txt for a full report.
4:54:28 AM: npm ERR! A complete log of this run can be found in:
4:54:28 AM: npm ERR!     /opt/buildhome/.npm/_logs/2022-06-05T11_54_27_177Z-debug-0.log
4:54:28 AM: Error during NPM install
4:54:28 AM: Build was terminated: Build script returned non-zero exit code: 1
4:54:28 AM: Failing build: Failed to build site
4:54:28 AM: Finished processing build request in 11.030808051s

My package.json is

{
  "name": "bithu",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@testing-library/jest-dom": "^5.16.4",
    "@testing-library/react": "^13.1.1",
    "@testing-library/user-event": "^13.5.0",
    "prop-types": "^15.8.1",
    "react": "^18.1.0",
    "react-accessible-accordion": "^5.0.0",
    "react-animations": "^1.0.0",
    "react-component-countdown-timer": "^0.1.8",
    "react-countup": "^6.2.0",
    "react-dom": "^18.1.0",
    "react-helmet": "^6.1.0",
    "react-icons": "^4.3.1",
    "react-router-dom": "^6.3.0",
    "react-scripts": "5.0.1",
    "react-slick": "^0.29.0",
    "react-visibility-sensor": "^5.1.1",
    "styled-components": "^5.3.5",
    "web-vitals": "^2.1.4"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}

The answer that I gave here also applies to you:

2 Likes