Failed during stage 'Install dependencies': dependency_installation script returned non-zero exit code

Hi,

I am getting an error when I am trying to deploy the code. Please see below the error message:

Initializing failed:
7:40:13 PM: Failed during stage ‘Install dependencies’: dependency_installation script returned non-zero exit code: 1

7:40:06 PM: build-image version: ad28fb91fae632ef7f2e4d659a892d68ee2681a6 (focal)

7:40:06 PM: buildbot version: a00c3a106ad0a66dd4bc30c43ab769447ea2db3e

7:40:06 PM: Fetching cached dependencies

7:40:06 PM: Failed to fetch cache, continuing with build

7:40:06 PM: Starting to prepare the repo for build

7:40:06 PM: No cached dependencies found. Cloning fresh repo

7:40:06 PM: git clone --filter=blob:none GitHub - Veenakrishna2313/crypto-tracker

7:40:06 PM: Preparing Git Reference refs/heads/master

7:40:08 PM: Starting to install dependencies

7:40:08 PM: Python version set to 3.8

7:40:08 PM: Attempting Ruby version 2.7.2, read from environment

7:40:08 PM: Using Ruby version 2.7.2

7:40:09 PM: Started restoring cached go cache

7:40:09 PM: Finished restoring cached go cache

7:40:09 PM: go version go1.19.11 linux/amd64

7:40:09 PM: Using PHP version 8.0

7:40:10 PM: v18.17.0 is already installed.

7:40:10 PM: Now using node v18.17.0 (npm v9.6.7)

7:40:10 PM: Enabling Node.js Corepack

7:40:11 PM: Started restoring cached build plugins

7:40:11 PM: Finished restoring cached build plugins

7:40:11 PM: Started restoring cached corepack dependencies

7:40:11 PM: Finished restoring cached corepack dependencies

7:40:11 PM: No npm workspaces detected

7:40:11 PM: Started restoring cached node modules

7:40:11 PM: Finished restoring cached node modules

7:40:11 PM: Installing npm packages using npm version 9.6.7

7:40:13 PM: npm ERR! code ERESOLVE

7:40:13 PM: npm ERR! ERESOLVE could not resolve

7:40:13 PM: npm ERR!

7:40:13 PM: npm ERR! While resolving: react-chartjs-2@5.2.0

7:40:13 PM: npm ERR! Found: chart.js@3.9.1

7:40:13 PM: npm ERR! node_modules/chart.js

7:40:13 PM: npm ERR! chart.js@^3.9.1 from the root project

7:40:13 PM: npm ERR! peer chart.js@>=3.0.0 from chartjs-plugin-datalabels@2.2.0

7:40:13 PM: npm ERR! node_modules/chartjs-plugin-datalabels

7:40:13 PM: npm ERR! chartjs-plugin-datalabels@^2.2.0 from the root project

7:40:13 PM: npm ERR!

7:40:13 PM: npm ERR! Could not resolve dependency:

7:40:13 PM: npm ERR! peer chart.js@^4.1.1 from react-chartjs-2@5.2.0

7:40:13 PM: npm ERR! node_modules/react-chartjs-2

7:40:13 PM: npm ERR! react-chartjs-2@^5.2.0 from the root project

7:40:13 PM: npm ERR!

7:40:13 PM: npm ERR! Conflicting peer dependency: chart.js@4.3.0

7:40:13 PM: npm ERR! node_modules/chart.js

7:40:13 PM: npm ERR! peer chart.js@^4.1.1 from react-chartjs-2@5.2.0

7:40:13 PM: npm ERR! node_modules/react-chartjs-2

7:40:13 PM: npm ERR! react-chartjs-2@^5.2.0 from the root project

7:40:13 PM: npm ERR!

7:40:13 PM: npm ERR! Fix the upstream dependency conflict, or retry

7:40:13 PM: npm ERR! this command with --force or --legacy-peer-deps

7:40:13 PM: npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

7:40:13 PM: npm ERR!

7:40:13 PM: npm ERR!

7:40:13 PM: npm ERR! For a full report see:

7:40:13 PM: npm ERR! /opt/buildhome/.npm/_logs/2023-07-21T02_40_11_391Z-eresolve-report.txt

7:40:13 PM: npm ERR! A complete log of this run can be found in: /opt/buildhome/.npm/_logs/2023-07-21T02_40_11_391Z-debug-0.log

7:40:13 PM: Error during npm install

7:40:13 PM: Build was terminated: dependency_installation script returned non-zero exit code: 1

7:40:13 PM: Failing build: Failed to install dependencies

whimsical-daffodil-ea56b0.netlify.app

I even tried the below, but nothing worked:

  1. Go to Site Settings > Build & Deploy > Continuous Deployment.
  2. Go to Build Settings > Edit Settings.
  3. Edit your Build Command to CI= npm run build (Look at the space between npm run build and =. It is very important to have it).
  4. In Publish Directory write build.
  5. Go to Environment > Edit Variables.
  6. You must write in Key the variable CI and in Value write false.
  7. Click on Save.
  8. Go to Deploys and in the second section, click on Trigger Deploy and select Clear Cache and Deploy Site.

Can you please help me?

Github:GitHub - Veenakrishna2313/crypto-tracker