Failed during stage 'building site': Build script returned non-zero exit code: 1

I’m trying to upload a website to Netlify. Shows an error. I need help, please

1:04:11 PM: Build ready to start

1:04:13 PM: build-image version: a49edbc55fc722f80f6b85963a5060f8d043a844 (focal)

1:04:13 PM: build-image tag: v4.8.1

1:04:13 PM: buildbot version: f89dd42aa70d76d1da992dc3fa004a4c745208bc

1:04:13 PM: Fetching cached dependencies

1:04:13 PM: Failed to fetch cache, continuing with build

1:04:13 PM: Starting to prepare the repo for build

1:04:13 PM: No cached dependencies found. Cloning fresh repo

1:04:13 PM: git clone GitHub - KudenikovNS/gatsby-first-project

1:04:13 PM: Preparing Git Reference refs/heads/main

1:04:14 PM: Parsing package.json dependencies

1:04:15 PM: Starting build script

1:04:15 PM: Installing dependencies

1:04:15 PM: Python version set to 2.7

1:04:16 PM: v16.15.1 is already installed.

1:04:16 PM: Now using node v16.15.1 (npm v8.11.0)

1:04:16 PM: Started restoring cached build plugins

1:04:16 PM: Finished restoring cached build plugins

1:04:16 PM: Attempting ruby version 2.7.2, read from environment

1:04:17 PM: Using ruby version 2.7.2

1:04:18 PM: Using PHP version 8.0

1:04:18 PM: No npm workspaces detected

1:04:18 PM: Started restoring cached node modules

1:04:18 PM: Finished restoring cached node modules

1:04:18 PM: Installing NPM modules using NPM version 8.11.0

1:04:19 PM: npm WARN config tmp This setting is no longer used. npm stores temporary files in a special

1:04:19 PM: npm WARN config location in the cache, and they are managed by

1:04:19 PM: npm WARN config cacache.

1:04:19 PM: npm WARN config tmp This setting is no longer used. npm stores temporary files in a special

1:04:19 PM: npm WARN config location in the cache, and they are managed by

1:04:19 PM: npm WARN config cacache.

1:04:21 PM: npm WARN ERESOLVE overriding peer dependency

1:04:21 PM: npm WARN While resolving: react-side-effect@2.1.1

1:04:21 PM: npm WARN Found: react@18.2.0

1:04:21 PM: npm WARN node_modules/react

1:04:21 PM: npm WARN react@“^18.1.0” from the root project

1:04:21 PM: npm WARN 9 more (@gatsbyjs/reach-router, gatsby, gatsby-link, …)

1:04:21 PM: npm WARN

1:04:21 PM: npm WARN Could not resolve dependency:

1:04:21 PM: npm WARN peer react@“^16.3.0 || ^17.0.0” from react-side-effect@2.1.1

1:04:21 PM: npm WARN node_modules/react-helmet/node_modules/react-side-effect

1:04:21 PM: npm WARN react-side-effect@“^2.1.0” from react-helmet@6.1.0

1:04:21 PM: npm WARN node_modules/react-helmet

1:04:21 PM: npm WARN

1:04:21 PM: npm WARN Conflicting peer dependency: react@17.0.2

1:04:21 PM: npm WARN node_modules/react

1:04:21 PM: npm WARN peer react@“^16.3.0 || ^17.0.0” from react-side-effect@2.1.1

1:04:21 PM: npm WARN node_modules/react-helmet/node_modules/react-side-effect

1:04:21 PM: npm WARN react-side-effect@“^2.1.0” from react-helmet@6.1.0

1:04:21 PM: npm WARN node_modules/react-helmet

1:04:50 PM: npm ERR! code E401

1:04:50 PM: npm ERR! Unable to authenticate, your authentication token seems to be invalid.

1:04:50 PM: npm ERR! To correct this please trying logging in again with:

1:04:50 PM: npm ERR! npm login

1:04:50 PM: npm ERR! A complete log of this run can be found in:

1:04:50 PM: Creating deploy upload records

1:04:50 PM: npm ERR! /opt/buildhome/.npm/_logs/2022-06-22T09_04_19_448Z-debug-0.log

1:04:50 PM: Error during NPM install

1:04:50 PM: Build was terminated: Build script returned non-zero exit code: 1

1:04:50 PM: Failing build: Failed to build site

1:04:50 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)

1:04:50 PM: Finished processing build request in 37.71039235s

1 Like

Help i have problem while deplying the site.
5:53:18 PM: Build ready to start
5:53:20 PM: build-image version: a49edbc55fc722f80f6b85963a5060f8d043a844 (focal)
5:53:20 PM: build-image tag: v4.8.1
5:53:20 PM: buildbot version: f89dd42aa70d76d1da992dc3fa004a4c745208bc
5:53:20 PM: Fetching cached dependencies
5:53:20 PM: Failed to fetch cache, continuing with build
5:53:20 PM: Starting to prepare the repo for build
5:53:21 PM: No cached dependencies found. Cloning fresh repo
5:53:21 PM: git clone GitHub - vijaySai-22/mr-repair
5:53:21 PM: Preparing Git Reference refs/heads/main
5:53:21 PM: Parsing package.json dependencies
5:53:22 PM: Starting build script
5:53:22 PM: Installing dependencies
5:53:22 PM: Python version set to 2.7
5:53:23 PM: v16.15.1 is already installed.
5:53:24 PM: Now using node v16.15.1 (npm v8.11.0)
5:53:24 PM: Started restoring cached build plugins
5:53:24 PM: Finished restoring cached build plugins
5:53:24 PM: Attempting ruby version 2.7.2, read from environment
5:53:25 PM: Using ruby version 2.7.2
5:53:25 PM: Using PHP version 8.0
5:53:25 PM: No npm workspaces detected
5:53:25 PM: Started restoring cached node modules
5:53:25 PM: Finished restoring cached node modules
5:53:26 PM: Installing NPM modules using NPM version 8.11.0
5:53:26 PM: npm WARN config tmp This setting is no longer used. npm stores temporary files in a special
5:53:26 PM: npm WARN config location in the cache, and they are managed by
5:53:26 PM: npm WARN config cacache.
5:53:26 PM: npm WARN config tmp This setting is no longer used. npm stores temporary files in a special
5:53:26 PM: npm WARN config location in the cache, and they are managed by
5:53:26 PM: npm WARN config cacache.
5:53:28 PM: npm ERR! code ERESOLVE
5:53:28 PM: npm ERR! ERESOLVE could not resolve
5:53:28 PM: npm ERR!
5:53:28 PM: npm ERR! While resolving: react-bootstrap-icons@1.8.1
5:53:28 PM: Creating deploy upload records
5:53:28 PM: npm ERR! Found: react@18.2.0
5:53:28 PM: npm ERR! node_modules/react
5:53:28 PM: npm ERR! react@“^18.2.0” from the root project
5:53:28 PM: npm ERR! peer react@“>=16.8.0” from @restart/hooks@0.4.6
5:53:28 PM: npm ERR! node_modules/@restart/hooks
5:53:28 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)
5:53:28 PM: npm ERR! @restart/hooks@“^0.4.0” from @restart/ui@1.2.0
5:53:28 PM: npm ERR! node_modules/@restart/ui
5:53:28 PM: npm ERR! @restart/ui@“^1.2.0” from react-bootstrap@2.3.0
5:53:28 PM: npm ERR! node_modules/react-bootstrap
5:53:28 PM: npm ERR! react-bootstrap@“^2.3.0” from the root project
5:53:28 PM: npm ERR! @restart/hooks@“^0.4.6” from react-bootstrap@2.3.0
5:53:28 PM: npm ERR! node_modules/react-bootstrap
5:53:28 PM: npm ERR! react-bootstrap@“^2.3.0” from the root project
5:53:28 PM: npm ERR! 11 more (@restart/ui, @testing-library/react, prop-types-extra, …)
5:53:28 PM: npm ERR!
5:53:28 PM: npm ERR! Could not resolve dependency:
5:53:28 PM: npm ERR! peer react@“^16.8.6 || ^17” from react-bootstrap-icons@1.8.1
5:53:28 PM: npm ERR! node_modules/react-bootstrap-icons
5:53:28 PM: npm ERR! react-bootstrap-icons@“^1.8.1” from the root project
5:53:28 PM: npm ERR!
5:53:28 PM: npm ERR! Conflicting peer dependency: react@17.0.2
5:53:28 PM: npm ERR! node_modules/react
5:53:28 PM: npm ERR! peer react@“^16.8.6 || ^17” from react-bootstrap-icons@1.8.1
5:53:28 PM: npm ERR! node_modules/react-bootstrap-icons
5:53:28 PM: npm ERR! react-bootstrap-icons@“^1.8.1” from the root project
5:53:28 PM: npm ERR!
5:53:28 PM: npm ERR! Fix the upstream dependency conflict, or retry
5:53:28 PM: npm ERR! this command with --force, or --legacy-peer-deps
5:53:28 PM: npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
5:53:28 PM: npm ERR!
5:53:28 PM: npm ERR! See /opt/buildhome/.npm/eresolve-report.txt for a full report.
5:53:28 PM: npm ERR! A complete log of this run can be found in:
5:53:28 PM: npm ERR! /opt/buildhome/.npm/_logs/2022-06-22T12_23_26_893Z-debug-0.log
5:53:28 PM: Error during NPM install
5:53:28 PM: Build was terminated: Build script returned non-zero exit code: 1
5:53:28 PM: Failing build: Failed to build site
5:53:28 PM: Finished processing build request in 8.126332957s

i have also same problem… please help me

Hiya, sorry you are having trouble with your build.

This Support Guide contains a ton of useful debugging tips that can likely help you solve your problem :slight_smile: Additionally, this Support Guide houses all of our resources for debugging build and deploy issues.

We also recommend trying to search the forums with the build error you encountered - it’s likely your question was already asked by someone else!

If you are still having problems, please provide as much information as you can on what you have already tried, what your build settings are, your package.json, etc. Thanks!

1 Like

[CLOSED… Solved, by setting NPM_FLAGS --force in environment variables of netlify deploy settings. Thank You]
I think this problem with react-qr-reader
I got error same like this (netlify error) while installing react-qr-reader in my project, at that time i install it forcefully (npm i react-qr-reader --force)
Please help to solve this problem

{
  "name": "mr-repair",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@testing-library/jest-dom": "^5.16.4",
    "@testing-library/react": "^13.3.0",
    "@testing-library/user-event": "^13.5.0",
    "firebase": "^9.6.11",
    "qrcode": "^1.5.0",
    "react": "^18.2.0",
    "react-bootstrap": "^2.3.0",
    "react-bootstrap-icons": "^1.8.4",
    "react-dom": "^18.2.0",
    "react-minimal-pie-chart": "^8.3.0",
    "react-qr-reader": "^3.0.0-beta-1",
    "react-router-dom": "^6.3.0",
    "react-scripts": "5.0.1",
    "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"
    ]
  }
}
8:13:31 AM: Build ready to start
8:13:33 AM: build-image version: a49edbc55fc722f80f6b85963a5060f8d043a844 (focal)
8:13:33 AM: build-image tag: v4.8.1
8:13:33 AM: buildbot version: 4d0ac5fd74188fe527fa2a661368485be00b8be6
8:13:33 AM: Fetching cached dependencies
8:13:34 AM: Finished downloading cache in 1.455533322s
8:13:34 AM: Starting to extract cache
8:13:39 AM: Finished extracting cache in 4.399458047s
8:13:39 AM: Finished fetching cache in 5.874868194s
8:13:39 AM: Starting to prepare the repo for build
8:13:39 AM: Preparing Git Reference refs/heads/main
8:13:39 AM: Parsing package.json dependencies
8:13:40 AM: Starting build script
8:13:40 AM: Installing dependencies
8:13:40 AM: Python version set to 2.7
8:13:40 AM: Started restoring cached node version
8:13:41 AM: Finished restoring cached node version
8:13:42 AM: v16.15.1 is already installed.
8:13:42 AM: Now using node v16.15.1 (npm v8.11.0)
8:13:42 AM: Started restoring cached build plugins
8:13:42 AM: Finished restoring cached build plugins
8:13:42 AM: Attempting ruby version 2.7.2, read from environment
8:13:43 AM: Using ruby version 2.7.2
8:13:43 AM: Using PHP version 8.0
8:13:44 AM: No npm workspaces detected
8:13:44 AM: Started restoring cached node modules
8:13:44 AM: Finished restoring cached node modules
8:13:44 AM: Installing NPM modules using NPM version 8.11.0
8:13:44 AM: npm WARN config tmp This setting is no longer used.  npm stores temporary files in a special
8:13:44 AM: npm WARN config location in the cache, and they are managed by
8:13:44 AM: npm WARN config     [`cacache`](http://npm.im/cacache).
8:13:45 AM: npm WARN config tmp This setting is no longer used.  npm stores temporary files in a special
8:13:45 AM: npm WARN config location in the cache, and they are managed by
8:13:45 AM: npm WARN config     [`cacache`](http://npm.im/cacache).
8:13:47 AM: npm ERR! code ERESOLVE
8:13:47 AM: npm ERR! ERESOLVE could not resolve
8:13:47 AM: npm ERR!
8:13:47 AM: Creating deploy upload records
8:13:47 AM: npm ERR! While resolving: react-qr-reader@3.0.0-beta-1
8:13:47 AM: npm ERR! Found: react@18.2.0
8:13:47 AM: npm ERR! node_modules/react
8:13:47 AM: npm ERR!   react@"^18.2.0" from the root project
8:13:47 AM: npm ERR!   peer react@"^16.8.0 || ^17.0.0-rc.1 || ^18.0.0" from @react-aria/ssr@3.2.0
8:13:47 AM: Failed during stage 'building site': Build script returned non-zero exit code: 1 (https://ntl.fyi/exit-code-1)
8:13:47 AM: npm ERR!   node_modules/@react-aria/ssr
8:13:47 AM: npm ERR!     @react-aria/ssr@"^3.0.1" from @restart/ui@1.2.0
8:13:47 AM: npm ERR!     node_modules/@restart/ui
8:13:47 AM: npm ERR!       @restart/ui@"^1.2.0" from react-bootstrap@2.3.0
8:13:47 AM: npm ERR!       node_modules/react-bootstrap
8:13:47 AM: npm ERR!         react-bootstrap@"^2.3.0" from the root project
8:13:47 AM: npm ERR!   13 more (@restart/hooks, @restart/ui, @testing-library/react, ...)
8:13:47 AM: npm ERR!
8:13:47 AM: npm ERR! Could not resolve dependency:
8:13:47 AM: npm ERR! peer react@"^16.8.0 || ^17.0.0" from react-qr-reader@3.0.0-beta-1
8:13:47 AM: npm ERR! node_modules/react-qr-reader
8:13:47 AM: npm ERR!   react-qr-reader@"^3.0.0-beta-1" from the root project
8:13:47 AM: npm ERR!
8:13:47 AM: npm ERR! Conflicting peer dependency: react@17.0.2
8:13:47 AM: npm ERR! node_modules/react
8:13:47 AM: npm ERR!   peer react@"^16.8.0 || ^17.0.0" from react-qr-reader@3.0.0-beta-1
8:13:47 AM: npm ERR!   node_modules/react-qr-reader
8:13:47 AM: npm ERR!     react-qr-reader@"^3.0.0-beta-1" from the root project
8:13:47 AM: npm ERR!
8:13:47 AM: npm ERR! Fix the upstream dependency conflict, or retry
8:13:47 AM: npm ERR! this command with --force, or --legacy-peer-deps
8:13:47 AM: npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
8:13:47 AM: npm ERR!
8:13:47 AM: npm ERR! See /opt/buildhome/.npm/eresolve-report.txt for a full report.
8:13:47 AM: npm ERR! A complete log of this run can be found in:
8:13:47 AM: npm ERR!     /opt/buildhome/.npm/_logs/2022-06-23T02_43_44_983Z-debug-0.log
8:13:47 AM: Error during NPM install
8:13:47 AM: Build was terminated: Build script returned non-zero exit code: 1
8:13:47 AM: Failing build: Failed to build site
8:13:47 AM: Finished processing build request in 14.696939942s