# Build script returned non-zero exit code: 1

**URL:** <https://answers.netlify.com/t/build-script-returned-non-zero-exit-code-1/8777>\
**Category:** Support\
**Tags:** building, deployment\
**Created:** [February 11, 2020, 10:36am UTC](https://answers.netlify.com/t/build-script-returned-non-zero-exit-code-1/8777 "2020-02-11T10:36:42Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrwrbnsn](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/andrwrbnsn/32/1381_2.png) [@andrwrbnsn](https://answers.netlify.com/u/andrwrbnsn)\
**Post date:** [February 11, 2020, 10:36am UTC](https://answers.netlify.com/t/build-script-returned-non-zero-exit-code-1/8777/1 "2020-02-11T10:36:42Z")

</div>

The build of a website has randomly stopped working — it builds fine on my local machine. It’s a gatsby site being deployed from GitHub.

[https://thirsty-newton-5e1c23.netlify.com/](https://thirsty-newton-5e1c23.netlify.com/)

```auto
10:28:51 AM: success onPostBootstrap - 0.146s
10:28:51 AM: ⠀
10:28:51 AM: info bootstrap finished - 9.453 s
10:28:51 AM: ⠀
10:29:17 AM: failed Building production JavaScript and CSS bundles - 24.941s
10:29:17 AM: error Generating JavaScript bundles failed
10:29:17 AM: Can't resolve 'gatsby-link' in '/opt/build/repo/.cache'
10:29:17 AM: error Generating JavaScript bundles failed
10:29:17 AM: Can't resolve 'gatsby-link' in '/opt/build/repo/.cache'
10:29:17 AM: error Generating JavaScript bundles failed
10:29:17 AM: Can't resolve 'gatsby-react-router-scroll' in '/opt/build/repo/.cache'
10:29:17 AM: not finished run queries - 25.544s
10:29:17 AM: not finished Generating image thumbnails - 25.406s
10:29:17 AM: Skipping functions preparation step: no functions directory set
10:29:17 AM: Caching artifacts
10:29:17 AM: Started saving node modules
10:29:17 AM: Finished saving node modules
10:29:17 AM: Started saving yarn cache
10:29:17 AM: Finished saving yarn cache
10:29:17 AM: Started saving pip cache
10:29:17 AM: Finished saving pip cache
10:29:17 AM: Started saving emacs cask dependencies
10:29:17 AM: Finished saving emacs cask dependencies
10:29:17 AM: Started saving maven dependencies
10:29:18 AM: Finished saving maven dependencies
10:29:18 AM: Started saving boot dependencies
10:29:18 AM: Finished saving boot dependencies
10:29:18 AM: Started saving go dependencies
10:29:18 AM: Finished saving go dependencies
10:29:18 AM: Error running command: Build script returned non-zero exit code: 1
10:29:18 AM: Failing build: Failed to build site
10:29:18 AM: failed during stage 'building site': Build script returned non-zero exit code: 1
10:29:18 AM: Finished processing build request in 2m18.388745534s

```

Does anyone have any ideas?

Edit: Before I cleared the cache the error was:

```auto
8:13:33 PM: warning gatsby > core-js@2.6.11: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
8:13:34 PM: warning gatsby > gatsby-cli > core-js@2.6.11: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
8:13:34 PM: error Couldn't find any versions for "@typescript-eslint/experimental-utils" that matches "2.19.2"
8:13:34 PM: info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
8:13:35 PM: Error: Couldn't find any versions for "@typescript-eslint/typescript-estree" that matches "2.19.2"
8:13:35 PM: at MessageError.ExtendableBuiltin (/opt/build/cache/yarn/lib/cli.js:721:66)
8:13:35 PM: at new MessageError (/opt/build/cache/yarn/lib/cli.js:750:123)
8:13:35 PM: at Function.<anonymous> (/opt/build/cache/yarn/lib/cli.js:50504:13)
8:13:35 PM: at Generator.next (<anonymous>)
8:13:35 PM: at step (/opt/build/cache/yarn/lib/cli.js:304:30)
8:13:35 PM: at /opt/build/cache/yarn/lib/cli.js:315:13
8:13:35 PM: failed during stage 'building site': Build script returned non-zero exit code: 1
8:13:35 PM: at process._tickCallback (internal/process/next_tick.js:68:7)
8:13:35 PM: Error during Yarn install
8:13:35 PM: Error running command: Build script returned non-zero exit code: 1
8:13:35 PM: Failing build: Failed to build site
8:13:35 PM: Shutting down logging, 1 messages pending
8:13:35 PM: Finished processing build request in 30.097734456s

```

---

<div class="post-metadata">

**Author:** ![perry](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/perry/32/16_2.png) [@perry](https://answers.netlify.com/u/perry)\
**Post date:** [February 11, 2020, 4:35pm UTC](https://answers.netlify.com/t/build-script-returned-non-zero-exit-code-1/8777/2 "2020-02-11T16:35:11Z")

</div>

hi there,  
a few quick questions.

Does the project build locally?  
do you mind posting your `package.json` please?

Looks like this is the problem:

```auto
8:13:34 PM: error Couldn't find any versions for "@typescript-eslint/experimental-utils" that matches "2.19.2"
8:13:34 PM: info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
8:13:35 PM: Error: Couldn't find any versions for "@typescript-eslint/typescript-estree" that matches "2.19.2"

```

---

<div class="post-metadata">

**Author:** ![andrwrbnsn](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/andrwrbnsn/32/1381_2.png) [@andrwrbnsn](https://answers.netlify.com/u/andrwrbnsn)\
**Post date:** [February 11, 2020, 5:36pm UTC](https://answers.netlify.com/t/build-script-returned-non-zero-exit-code-1/8777/3 "2020-02-11T17:36:10Z")

</div>

Hi Perry,

No problems — the project does build fine locally, the package.json is below:

```auto
{
  "name": "gatsby-starter-default",
  "private": true,
  "description": "A simple starter to get up and developing quickly with Gatsby",
  "version": "0.1.0",
  "author": "Kyle Mathews <mathews.kyle@gmail.com>",
  "dependencies": {
    "@emotion/core": "^10.0.21",
    "@emotion/styled": "^10.0.17",
    "gatsby": "^2.19.12",
    "gatsby-image": "^2.2.40",
    "gatsby-plugin-emotion": "^4.1.22",
    "gatsby-plugin-manifest": "^2.2.41",
    "gatsby-plugin-offline": "^3.0.34",
    "gatsby-plugin-react-helmet": "^3.1.22",
    "gatsby-plugin-react-svg": "^2.1.2",
    "gatsby-plugin-sharp": "^2.4.5",
    "gatsby-plugin-web-font-loader": "^1.0.4",
    "gatsby-source-filesystem": "^2.1.48",
    "gatsby-source-instagram": "^0.5.1",
    "gatsby-source-prismic": "^2.3.0-alpha.3",
    "gatsby-transformer-json": "^2.2.26",
    "gatsby-transformer-remark": "^2.6.50",
    "gatsby-transformer-sharp": "^2.3.14",
    "html-to-react": "^1.4.2",
    "prismic-reactjs": "^1.2.0",
    "prop-types": "^15.7.2",
    "react": "^16.10.2",
    "react-dom": "^16.10.2",
    "react-helmet": "^5.2.1"
  },
  "devDependencies": {
    "prettier": "^1.18.2"
  },
  "keywords": [
    "gatsby"
  ],
  "license": "MIT",
  "scripts": {
    "build": "gatsby build",
    "develop": "gatsby develop",
    "format": "prettier --write \"**/*.{js,jsx,json,md}\"",
    "start": "npm run develop",
    "serve": "gatsby serve",
    "test": "echo \"Write tests! -> https://gatsby.dev/unit-testing \""
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/gatsbyjs/gatsby-starter-default"
  },
  "bugs": {
    "url": "https://github.com/gatsbyjs/gatsby/issues"
  }
}

```

---

<div class="post-metadata">

**Author:** ![perry](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/perry/32/16_2.png) [@perry](https://answers.netlify.com/u/perry)\
**Post date:** [February 11, 2020, 5:50pm UTC](https://answers.netlify.com/t/build-script-returned-non-zero-exit-code-1/8777/4 "2020-02-11T17:50:42Z")

</div>

i would probably try updating to the newest gatsby version as the next step:

> **[gatsby](https://www.npmjs.com/package/gatsby)**
>
> Blazing fast modern site generator for React. Latest version: 5.5.0, last published: a day ago. Start using gatsby in your project by running \`npm i gatsby\`. There are 960 other projects in the npm registry using gatsby.

---

<div class="post-metadata">

**Author:** ![andrwrbnsn](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/andrwrbnsn/32/1381_2.png) [@andrwrbnsn](https://answers.netlify.com/u/andrwrbnsn)\
**Post date:** [February 11, 2020, 9:13pm UTC](https://answers.netlify.com/t/build-script-returned-non-zero-exit-code-1/8777/5 "2020-02-11T21:13:32Z")

</div>

Hi Perry,

I tried updating gatsby but I’m still reaching the same conclusion — I’ve put my entire build log below, it looks like there are a few things going wrong:

```auto
8:57:12 PM: Build ready to start
8:57:14 PM: build-image version: 8e315e54bc4032a32e73290be556cde4f8348c12
8:57:14 PM: build-image tag: v2.8.2
8:57:14 PM: buildbot version: 45cd00068410d70db72c9672cdd014995488e12a
8:57:14 PM: Fetching cached dependencies
8:57:14 PM: Starting to download cache of 254.9KB
8:57:14 PM: Finished downloading cache in 87.369833ms
8:57:14 PM: Starting to extract cache
8:57:14 PM: Failed to fetch cache, continuing with build
8:57:14 PM: Starting to prepare the repo for build
8:57:15 PM: No cached dependencies found. Cloning fresh repo
8:57:15 PM: git clone https://github.com/andrwrbnsn/fromworks
8:57:16 PM: Preparing Git Reference refs/heads/master
8:57:16 PM: Starting build script
8:57:16 PM: Installing dependencies
8:57:17 PM: Downloading and installing node v10.19.0...
8:57:18 PM: Downloading https://nodejs.org/dist/v10.19.0/node-v10.19.0-linux-x64.tar.xz...
8:57:18 PM: 
#####################
8:57:18 PM: 30.4%
8:57:18 PM: 
###############################################
8:57:18 PM: ######################### 100.0%
8:57:18 PM: Computing checksum with sha256sum
8:57:18 PM: Checksums matched!
8:57:21 PM: Now using node v10.19.0 (npm v6.13.4)
8:57:21 PM: Attempting ruby version 2.6.2, read from environment
8:57:22 PM: Using ruby version 2.6.2
8:57:22 PM: Using PHP version 5.6
8:57:22 PM: Started restoring cached node modules
8:57:23 PM: Finished restoring cached node modules
8:57:23 PM: Started restoring cached yarn cache
8:57:23 PM: Finished restoring cached yarn cache
8:57:23 PM: Installing yarn at version 1.17.0
8:57:23 PM: Installing Yarn!
8:57:23 PM: > Downloading tarball...
8:57:23 PM: [1/2]: https://yarnpkg.com/downloads/1.17.0/yarn-
8:57:23 PM: v1.17.0.tar.gz --> /tmp/yarn.tar.gz.7zZysmbNDF
8:57:23 PM: % Total % Received %
8:57:23 PM: Xferd Average Speed Time Time
8:57:23 PM: Time Current
8:57:23 PM: Dl
8:57:23 PM: oad Upload Total Spent Le
8:57:23 PM: ft Speed
8:57:23 PM: 
  0 0 0 0
8:57:23 PM: 0 0 0 0 --:--:-- --:--:-- --
8:57:23 PM: :--:-- 0
8:57:23 PM: 
100 80 100 80 0 0 534 0 -
8:57:23 PM: -:--:-- --:--:-- --:--:-- 536
8:57:23 PM: 
100 93 100 93 0 0 267 0 --:--
8:57:23 PM: :-- --:--:-- --:--:-- 267
8:57:23 PM: 
  0 0 0 0 0 0 0 0 --:--:
8:57:23 PM: -- --:--:-- --:--:-- 0
8:57:23 PM: 
  0 0 0 609 0 0 996 0 --:--:-- -
8:57:23 PM: -:--:-- --:--:-- 3929
8:57:23 PM: 
100 1213k 100 1213k 0 0 1308k 0 --:--:-- --:--:-- --:--:-- 13
8:57:23 PM: 08k
8:57:23 PM: [2/2]: https://yarnpkg.com/downloads/1.17
8:57:23 PM: .0/yarn-v1.17.0.tar.gz.asc --> /tmp/yarn.tar.gz.7zZysmbNDF.asc
8:57:23 PM: 
100 84 100
8:57:23 PM: 84 0 0 2834 0 --:--:-- --:--:-- --:--:-- 2834
8:57:24 PM: 
100 97 100 97 0 0
8:57:24 PM: 1566 0 --:--:-- --:--:-- --:--:-- 1566
8:57:24 PM: 
  0 0 0 613 0 0 3025 0
8:57:24 PM: --:--:-- --:--:-- --:--:-- 3025
8:57:24 PM: 
100 832 100 832 0 0 3370 0 --:--:-- --:--:-- --:--:-- 3370
8:57:24 PM: > Verifying integrity...
8:57:24 PM: gpg: Signature made Fri 14 Jun 2019 06:55:58 PM UTC using RSA key ID 69475BAA
8:57:24 PM: gpg: Good signature from "Yarn Packaging <yarn@dan.cx>"
8:57:24 PM: gpg: Note: This key has expired!
8:57:24 PM: Primary key fingerprint: 72EC F46A 56B4 AD39 C907
8:57:24 PM: BBB7 1646 B01B 86E5 0310
8:57:24 PM: Subkey fingerprint: 6D98 490C 6F1A CDDD 448E 4595 4F77 6793 6947 5BAA
8:57:24 PM: > GPG signature looks good
8:57:24 PM: > Extracting to ~/.yarn...
8:57:24 PM: > Adding to $PATH...
8:57:24 PM: > We've added the following to your /opt/buildhome/.profile
8:57:24 PM: > If this isn't the profile of your current shell then please add the following to your correct profile:
8:57:24 PM: export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
8:57:24 PM: 
8:57:24 PM: > Successfully installed Yarn 1.17.0! Please open another terminal where the `yarn` command will now be available.
8:57:25 PM: Installing NPM modules using Yarn version 1.17.0
8:57:25 PM: yarn install v1.17.0
8:57:26 PM: warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
8:57:26 PM: [1/4] Resolving packages...
8:57:28 PM: [2/4] Fetching packages...
8:57:54 PM: info fsevents@2.1.2: The platform "linux" is incompatible with this module.
8:57:54 PM: info "fsevents@2.1.2" is an optional dependency and failed compatibility check. Excluding it from installation.
8:57:54 PM: info fsevents@1.2.9: The platform "linux" is incompatible with this module.
8:57:54 PM: info "fsevents@1.2.9" is an optional dependency and failed compatibility check. Excluding it from installation.
8:57:54 PM: info fsevents@2.1.1: The platform "linux" is incompatible with this module.
8:57:54 PM: info "fsevents@2.1.1" is an optional dependency and failed compatibility check. Excluding it from installation.
8:57:54 PM: [3/4] Linking dependencies...
8:57:54 PM: warning "gatsby > react-hot-loader@4.12.19" has unmet peer dependency "@types/react@^15.0.0 || ^16.0.0".
8:57:54 PM: warning "gatsby > @typescript-eslint/eslint-plugin > tsutils@3.17.1" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
8:57:54 PM: warning "gatsby-plugin-emotion > @emotion/babel-preset-css-prop@10.0.27" has unmet peer dependency "@babel/core@^7.0.0".
8:57:54 PM: warning "gatsby-plugin-emotion > @emotion/babel-preset-css-prop > @babel/plugin-transform-react-jsx@7.3.0" has unmet peer dependency "@babel/core@^7.0.0-0".
8:57:54 PM: warning "gatsby-plugin-emotion > @emotion/babel-preset-css-prop > @emotion/babel-plugin-jsx-pragmatic@0.1.5" has unmet peer dependency "@babel/core@^7.0.0".
8:57:54 PM: warning "gatsby-plugin-emotion > @emotion/babel-preset-css-prop > @babel/plugin-transform-react-jsx > @babel/plugin-syntax-jsx@7.2.0" has unmet peer dependency "@babel/core@^7.0.0-0".
8:57:54 PM: warning "gatsby-source-instagram > @babel/preset-env@7.6.3" has unmet peer dependency "@babel/core@^7.0.0-0".
8:57:54 PM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-proposal-async-generator-functions@7.2.0" has unmet peer dependency "@babel/core@^7.0.0-0".
8:57:54 PM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-proposal-dynamic-import@7.5.0" has unmet peer dependency "@babel/core@^7.0.0-0".
8:57:54 PM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-proposal-json-strings@7.2.0" has unmet peer dependency "@babel/core@^7.0.0-0".
8:57:54 PM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-proposal-object-rest-spread@7.6.2" has unmet peer dependency "@babel/core@^7.0.0-0".
8:57:54 PM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-proposal-optional-catch-binding@7.2.0" has unmet peer dependency "@babel/core@^7.0.0-0".
8:57:54 PM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-proposal-unicode-property-regex@7.6.2" has unmet peer dependency "@babel/core@^7.0.0-0".
8:57:54 PM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-syntax-async-generators@7.2.0" has unmet peer dependency "@babel/core@^7.0.0-0".
8:57:54 PM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-syntax-dynamic-import@7.2.0" has unmet peer dependency "@babel/core@^7.0.0-0".
8:57:54 PM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-syntax-json-strings@7.2.0" has unmet peer dependency "@babel/core@^7.0.0-0".
8:57:54 PM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-syntax-object-rest-spread@7.2.0" has unmet peer dependency "@babel/core@^7.0.0-0".
8:57:54 PM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-syntax-optional-catch-binding@7.2.0" has unmet peer dependency "@babel/core@^7.0.0-0".
8:57:54 PM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-arrow-functions@7.2.0" has unmet peer dependency "@babel/core@^7.0.0-0".
8:57:54 PM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-async-to-generator@7.5.0" has unmet peer dependency "@babel/core@^7.0.0-0".
8:57:54 PM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-block-scoped-functions@7.2.0" has unmet peer dependency "@babel/core@^7.0.0-0".
8:57:54 PM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-block-scoping@7.6.3" has unmet peer dependency "@babel/core@^7.0.0-0".
8:57:54 PM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-classes@7.5.5" has unmet peer dependency "@babel/core@^7.0.0-0".
8:57:54 PM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-computed-properties@7.2.0" has unmet peer dependency "@babel/core@^7.0.0-0".
8:57:54 PM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-destructuring@7.6.0" has unmet peer dependency "@babel/core@^7.0.0-0".
8:57:54 PM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-dotall-regex@7.6.2" has unmet peer dependency "@babel/core@^7.0.0-0".
8:57:54 PM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-duplicate-keys@7.5.0" has unmet peer dependency "@babel/core@^7.0.0-0".
8:57:54 PM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-exponentiation-operator@7.2.0" has unmet peer dependency "@babel/core@^7.0.0-0".
8:57:54 PM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-for-of@7.4.4" has unmet peer dependency "@babel/core@^7.0.0-0".
8:57:54 PM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-function-name@7.4.4" has unmet peer dependency "@babel/core@^7.0.0-0".
8:57:54 PM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-literals@7.2.0" has unmet peer dependency "@babel/core@^7.0.0-0".
8:57:54 PM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-member-expression-literals@7.2.0" has unmet peer dependency "@babel/core@^7.0.0-0".
8:57:54 PM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-modules-amd@7.5.0" has unmet peer dependency "@babel/core@^7.0.0-0".
8:57:54 PM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-modules-commonjs@7.6.0" has unmet peer dependency "@babel/core@^7.0.0-0".
8:57:54 PM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-modules-systemjs@7.5.0" has unmet peer dependency "@babel/core@^7.0.0-0".
8:57:54 PM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-modules-umd@7.2.0" has unmet peer dependency "@babel/core@^7.0.0-0".
8:57:54 PM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-named-capturing-groups-regex@7.6.3" has unmet peer dependency "@babel/core@^7.0.0".
8:57:54 PM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-new-target@7.4.4" has unmet peer dependency "@babel/core@^7.0.0-0".
8:57:54 PM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-object-super@7.5.5" has unmet peer dependency "@babel/core@^7.0.0-0".
8:57:54 PM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-parameters@7.4.4" has unmet peer dependency "@babel/core@^7.0.0-0".
8:57:54 PM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-property-literals@7.2.0" has unmet peer dependency "@babel/core@^7.0.0-0".
8:57:54 PM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-regenerator@7.4.5" has unmet peer dependency "@babel/core@^7.0.0-0".
8:57:54 PM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-reserved-words@7.2.0" has unmet peer dependency "@babel/core@^7.0.0-0".
8:57:54 PM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-shorthand-properties@7.2.0" has unmet peer dependency "@babel/core@^7.0.0-0".
8:57:54 PM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-spread@7.6.2" has unmet peer dependency "@babel/core@^7.0.0-0".
8:57:54 PM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-sticky-regex@7.2.0" has unmet peer dependency "@babel/core@^7.0.0-0".
8:57:54 PM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-template-literals@7.4.4" has unmet peer dependency "@babel/core@^7.0.0-0".
8:57:54 PM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-typeof-symbol@7.2.0" has unmet peer dependency "@babel/core@^7.0.0-0".
8:57:54 PM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-unicode-regex@7.6.2" has unmet peer dependency "@babel/core@^7.0.0-0".
8:57:54 PM: warning "gatsby-source-prismic > easygraphql-mock > easygraphql-parser@0.0.12" has unmet peer dependency "graphql@^0.13.0 || ^14.0.0".
8:57:54 PM: warning "gatsby-source-prismic > easygraphql-mock > easygraphql-parser > merge-graphql-schemas > graphql-toolkit@0.5.0" has unmet peer dependency "graphql-tag-pluck@^0.8.3".
8:58:18 PM: [4/4] Building fresh packages...
8:58:27 PM: success Saved lockfile.
8:58:27 PM: Done in 61.92s.
8:58:28 PM: NPM modules installed using Yarn
8:58:28 PM: Started restoring cached go cache
8:58:28 PM: Finished restoring cached go cache
8:58:28 PM: unset GOOS;
8:58:28 PM: unset GOARCH;
8:58:28 PM: export GOROOT='/opt/buildhome/.gimme/versions/go1.12.linux.amd64';
8:58:28 PM: export PATH="/opt/buildhome/.gimme/versions/go1.12.linux.amd64/bin:${PATH}";
8:58:28 PM: go version >&2;
8:58:28 PM: export GIMME_ENV='/opt/buildhome/.gimme/env/go1.12.linux.amd64.env';
8:58:28 PM: go version go1.12 linux/amd64
8:58:28 PM: Installing missing commands
8:58:28 PM: Verify run directory
8:58:28 PM: Executing user command: gatsby build
8:58:31 PM: success open and validate gatsby-configs - 0.094s
8:58:33 PM: success load plugins - 1.354s
8:58:33 PM: success onPreInit - 0.004s
8:58:33 PM: success delete html and css files from previous builds - 0.014s
8:58:33 PM: success initialize cache - 0.009s
8:58:33 PM: success copy gatsby files - 0.035s
8:58:33 PM: success onPreBootstrap - 0.016s
8:58:33 PM: success createSchemaCustomization - 0.007s
8:58:33 PM: Starting to fetch data from Prismic
8:58:33 PM: Fetch Prismic data: 317.241ms
8:58:37 PM: Starting to fetch data from Prismic
8:58:37 PM: Fetch Prismic data: 198.516ms
8:58:37 PM: success source and transform nodes - 4.331s
8:58:38 PM: success building schema - 0.835s
8:58:38 PM: success createPages - 0.091s
8:58:38 PM: success createPagesStatefully - 0.092s
8:58:38 PM: success onPreExtractQueries - 0.002s
8:58:39 PM: success update schema - 0.031s
8:58:39 PM: success extract queries from components - 0.652s
8:58:39 PM: success write out requires - 0.005s
8:58:39 PM: success write out redirect data - 0.001s
8:58:39 PM: success Build manifest and related icons - 0.141s
8:58:39 PM: success onPostBootstrap - 0.166s
8:58:39 PM: ⠀
8:58:39 PM: info bootstrap finished - 11.390 s
8:58:39 PM: ⠀
8:59:02 PM: failed Building production JavaScript and CSS bundles - 22.360s
8:59:02 PM: error Generating JavaScript bundles failed
8:59:02 PM: Can't resolve 'gatsby-link' in '/opt/build/repo/.cache'
8:59:02 PM: error Generating JavaScript bundles failed
8:59:02 PM: Can't resolve 'gatsby-link' in '/opt/build/repo/.cache'
8:59:02 PM: error Generating JavaScript bundles failed
8:59:02 PM: Can't resolve 'gatsby-react-router-scroll' in '/opt/build/repo/.cache'
8:59:02 PM: not finished run queries - 22.916s
8:59:02 PM: not finished Generating image thumbnails - 22.928s
8:59:03 PM: Skipping functions preparation step: no functions directory set
8:59:03 PM: Caching artifacts
8:59:03 PM: Started saving node modules
8:59:03 PM: Finished saving node modules
8:59:03 PM: Started saving yarn cache
8:59:03 PM: Finished saving yarn cache
8:59:03 PM: Started saving pip cache
8:59:03 PM: Finished saving pip cache
8:59:03 PM: Started saving emacs cask dependencies
8:59:03 PM: Finished saving emacs cask dependencies
8:59:03 PM: Started saving maven dependencies
8:59:03 PM: Finished saving maven dependencies
8:59:03 PM: Started saving boot dependencies
8:59:03 PM: Finished saving boot dependencies
8:59:03 PM: Started saving go dependencies
8:59:03 PM: Finished saving go dependencies
8:59:05 PM: Error running command: Build script returned non-zero exit code: 1
8:59:05 PM: Failing build: Failed to build site
8:59:06 PM: failed during stage 'building site': Build script returned non-zero exit code: 1
8:59:06 PM: Finished processing build request in 1m51.620059719s

```

Thanks for your help by the way.

---

<div class="post-metadata">

**Author:** ![jen](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/jen/32/6044_2.png) [@jen](https://answers.netlify.com/u/jen)\
**Post date:** [February 12, 2020, 12:21am UTC](https://answers.netlify.com/t/build-script-returned-non-zero-exit-code-1/8777/6 "2020-02-12T00:21:12Z")

</div>

You mentioned that you cleared your cache. Did you do that in the Netlify UI? So, when the build failed, clicking **Retry deploy \> Clear cache** as described here:

> **[Build troubleshooting tips](https://docs.netlify.com/configure-builds/troubleshooting-tips/#build-cache)**
>
> Find troubleshooting tips for failing builds, learn how to address certain build errors, and access additional support resources.

I ask because your build image version is 2.8.2 but we’re currently deploying 3.3.5. Just wanna confirm we’re on the same page before suggesting next steps! Let me know and we’ll go from there 🙂

---

<div class="post-metadata">

**Author:** ![andrwrbnsn](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/andrwrbnsn/32/1381_2.png) [@andrwrbnsn](https://answers.netlify.com/u/andrwrbnsn)\
**Post date:** [February 12, 2020, 9:23am UTC](https://answers.netlify.com/t/build-script-returned-non-zero-exit-code-1/8777/7 "2020-02-12T09:23:19Z")

</div>

Hi Jen,

That’s correct I cleared the cache within the Netlify UI — also the build image was old as I thought using the Trusty image might fix the issue but it didn’t — here’s the latest build log:

```auto
9:07:37 AM: Build ready to start
9:07:40 AM: build-image version: 9cade8af58c2cf3a17a1e9433d2e979149488837
9:07:40 AM: build-image tag: v3.3.5
9:07:40 AM: buildbot version: 2fd8f04962d5dbc77b79b9c2f5ab7a077e87376b
9:07:40 AM: Fetching cached dependencies
9:07:40 AM: Starting to download cache of 265.4MB
9:07:46 AM: Finished downloading cache in 6.491825413s
9:07:46 AM: Starting to extract cache
9:07:56 AM: Finished extracting cache in 9.775476093s
9:07:56 AM: Finished fetching cache in 16.3854786s
9:07:56 AM: Starting to prepare the repo for build
9:07:57 AM: Preparing Git Reference refs/heads/master
9:07:58 AM: Starting build script
9:07:58 AM: Installing dependencies
9:07:58 AM: Started restoring cached node version
9:08:03 AM: Finished restoring cached node version
9:08:04 AM: v10.19.0 is already installed.
9:08:05 AM: Now using node v10.19.0 (npm v6.13.4)
9:08:06 AM: Attempting ruby version 2.6.2, read from environment
9:08:07 AM: Using ruby version 2.6.2
9:08:07 AM: Using PHP version 5.6
9:08:07 AM: Started restoring cached node modules
9:08:07 AM: Finished restoring cached node modules
9:08:07 AM: Started restoring cached yarn cache
9:08:07 AM: Finished restoring cached yarn cache
9:08:08 AM: Installing NPM modules using Yarn version 1.17.0
9:08:09 AM: yarn install v1.17.0
9:08:09 AM: warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
9:08:09 AM: [1/4] Resolving packages...
9:08:10 AM: [2/4] Fetching packages...
9:08:34 AM: info fsevents@2.1.2: The platform "linux" is incompatible with this module.
9:08:34 AM: info "fsevents@2.1.2" is an optional dependency and failed compatibility check. Excluding it from installation.
9:08:34 AM: info fsevents@1.2.9: The platform "linux" is incompatible with this module.
9:08:34 AM: info "fsevents@1.2.9" is an optional dependency and failed compatibility check. Excluding it from installation.
9:08:34 AM: info fsevents@2.1.1: The platform "linux" is incompatible with this module.
9:08:34 AM: info "fsevents@2.1.1" is an optional dependency and failed compatibility check. Excluding it from installation.
9:08:34 AM: [3/4] Linking dependencies...
9:08:34 AM: warning "gatsby > react-hot-loader@4.12.19" has unmet peer dependency "@types/react@^15.0.0 || ^16.0.0".
9:08:34 AM: warning "gatsby > @typescript-eslint/eslint-plugin > tsutils@3.17.1" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
9:08:34 AM: warning "gatsby-plugin-emotion > @emotion/babel-preset-css-prop@10.0.27" has unmet peer dependency "@babel/core@^7.0.0".
9:08:34 AM: warning "gatsby-plugin-emotion > @emotion/babel-preset-css-prop > @babel/plugin-transform-react-jsx@7.3.0" has unmet peer dependency "@babel/core@^7.0.0-0".
9:08:34 AM: warning "gatsby-plugin-emotion > @emotion/babel-preset-css-prop > @emotion/babel-plugin-jsx-pragmatic@0.1.5" has unmet peer dependency "@babel/core@^7.0.0".
9:08:34 AM: warning "gatsby-plugin-emotion > @emotion/babel-preset-css-prop > @babel/plugin-transform-react-jsx > @babel/plugin-syntax-jsx@7.2.0" has unmet peer dependency "@babel/core@^7.0.0-0".
9:08:34 AM: warning "gatsby-source-instagram > @babel/preset-env@7.6.3" has unmet peer dependency "@babel/core@^7.0.0-0".
9:08:34 AM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-proposal-async-generator-functions@7.2.0" has unmet peer dependency "@babel/core@^7.0.0-0".
9:08:34 AM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-proposal-dynamic-import@7.5.0" has unmet peer dependency "@babel/core@^7.0.0-0".
9:08:34 AM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-proposal-json-strings@7.2.0" has unmet peer dependency "@babel/core@^7.0.0-0".
9:08:34 AM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-proposal-object-rest-spread@7.6.2" has unmet peer dependency "@babel/core@^7.0.0-0".
9:08:34 AM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-proposal-optional-catch-binding@7.2.0" has unmet peer dependency "@babel/core@^7.0.0-0".
9:08:34 AM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-proposal-unicode-property-regex@7.6.2" has unmet peer dependency "@babel/core@^7.0.0-0".
9:08:34 AM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-syntax-async-generators@7.2.0" has unmet peer dependency "@babel/core@^7.0.0-0".
9:08:34 AM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-syntax-dynamic-import@7.2.0" has unmet peer dependency "@babel/core@^7.0.0-0".
9:08:34 AM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-syntax-json-strings@7.2.0" has unmet peer dependency "@babel/core@^7.0.0-0".
9:08:34 AM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-syntax-object-rest-spread@7.2.0" has unmet peer dependency "@babel/core@^7.0.0-0".
9:08:34 AM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-syntax-optional-catch-binding@7.2.0" has unmet peer dependency "@babel/core@^7.0.0-0".
9:08:34 AM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-arrow-functions@7.2.0" has unmet peer dependency "@babel/core@^7.0.0-0".
9:08:34 AM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-async-to-generator@7.5.0" has unmet peer dependency "@babel/core@^7.0.0-0".
9:08:34 AM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-block-scoped-functions@7.2.0" has unmet peer dependency "@babel/core@^7.0.0-0".
9:08:34 AM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-block-scoping@7.6.3" has unmet peer dependency "@babel/core@^7.0.0-0".
9:08:34 AM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-classes@7.5.5" has unmet peer dependency "@babel/core@^7.0.0-0".
9:08:34 AM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-computed-properties@7.2.0" has unmet peer dependency "@babel/core@^7.0.0-0".
9:08:34 AM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-destructuring@7.6.0" has unmet peer dependency "@babel/core@^7.0.0-0".
9:08:34 AM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-dotall-regex@7.6.2" has unmet peer dependency "@babel/core@^7.0.0-0".
9:08:34 AM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-duplicate-keys@7.5.0" has unmet peer dependency "@babel/core@^7.0.0-0".
9:08:34 AM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-exponentiation-operator@7.2.0" has unmet peer dependency "@babel/core@^7.0.0-0".
9:08:34 AM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-for-of@7.4.4" has unmet peer dependency "@babel/core@^7.0.0-0".
9:08:34 AM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-function-name@7.4.4" has unmet peer dependency "@babel/core@^7.0.0-0".
9:08:34 AM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-literals@7.2.0" has unmet peer dependency "@babel/core@^7.0.0-0".
9:08:34 AM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-member-expression-literals@7.2.0" has unmet peer dependency "@babel/core@^7.0.0-0".
9:08:34 AM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-modules-amd@7.5.0" has unmet peer dependency "@babel/core@^7.0.0-0".
9:08:34 AM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-modules-commonjs@7.6.0" has unmet peer dependency "@babel/core@^7.0.0-0".
9:08:34 AM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-modules-systemjs@7.5.0" has unmet peer dependency "@babel/core@^7.0.0-0".
9:08:34 AM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-modules-umd@7.2.0" has unmet peer dependency "@babel/core@^7.0.0-0".
9:08:34 AM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-named-capturing-groups-regex@7.6.3" has unmet peer dependency "@babel/core@^7.0.0".
9:08:34 AM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-new-target@7.4.4" has unmet peer dependency "@babel/core@^7.0.0-0".
9:08:34 AM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-object-super@7.5.5" has unmet peer dependency "@babel/core@^7.0.0-0".
9:08:34 AM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-parameters@7.4.4" has unmet peer dependency "@babel/core@^7.0.0-0".
9:08:34 AM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-property-literals@7.2.0" has unmet peer dependency "@babel/core@^7.0.0-0".
9:08:34 AM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-regenerator@7.4.5" has unmet peer dependency "@babel/core@^7.0.0-0".
9:08:34 AM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-reserved-words@7.2.0" has unmet peer dependency "@babel/core@^7.0.0-0".
9:08:34 AM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-shorthand-properties@7.2.0" has unmet peer dependency "@babel/core@^7.0.0-0".
9:08:34 AM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-spread@7.6.2" has unmet peer dependency "@babel/core@^7.0.0-0".
9:08:34 AM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-sticky-regex@7.2.0" has unmet peer dependency "@babel/core@^7.0.0-0".
9:08:34 AM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-template-literals@7.4.4" has unmet peer dependency "@babel/core@^7.0.0-0".
9:08:34 AM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-typeof-symbol@7.2.0" has unmet peer dependency "@babel/core@^7.0.0-0".
9:08:34 AM: warning "gatsby-source-instagram > @babel/preset-env > @babel/plugin-transform-unicode-regex@7.6.2" has unmet peer dependency "@babel/core@^7.0.0-0".
9:08:34 AM: warning "gatsby-source-prismic > easygraphql-mock > easygraphql-parser@0.0.12" has unmet peer dependency "graphql@^0.13.0 || ^14.0.0".
9:08:34 AM: warning "gatsby-source-prismic > easygraphql-mock > easygraphql-parser > merge-graphql-schemas > graphql-toolkit@0.5.0" has unmet peer dependency "graphql-tag-pluck@^0.8.3".
9:08:58 AM: [4/4] Building fresh packages...
9:09:03 AM: success Saved lockfile.
9:09:03 AM: Done in 54.18s.
9:09:03 AM: NPM modules installed using Yarn
9:09:03 AM: Started restoring cached go cache
9:09:03 AM: Finished restoring cached go cache
9:09:03 AM: unset GOOS;
9:09:03 AM: unset GOARCH;
9:09:03 AM: export GOROOT='/opt/buildhome/.gimme/versions/go1.12.linux.amd64';
9:09:03 AM: export PATH="/opt/buildhome/.gimme/versions/go1.12.linux.amd64/bin:${PATH}";
9:09:03 AM: go version >&2;
9:09:03 AM: export GIMME_ENV='/opt/buildhome/.gimme/env/go1.12.linux.amd64.env';
9:09:03 AM: go version go1.12 linux/amd64
9:09:03 AM: Installing missing commands
9:09:03 AM: Verify run directory
9:09:03 AM: Executing user command: gatsby build
9:09:06 AM: success open and validate gatsby-configs - 0.056s
9:09:07 AM: success load plugins - 1.293s
9:09:07 AM: success onPreInit - 0.003s
9:09:07 AM: success delete html and css files from previous builds - 0.012s
9:09:07 AM: success initialize cache - 0.007s
9:09:07 AM: success copy gatsby files - 0.039s
9:09:07 AM: success onPreBootstrap - 0.017s
9:09:07 AM: success createSchemaCustomization - 0.006s
9:09:07 AM: Starting to fetch data from Prismic
9:09:08 AM: Fetch Prismic data: 472.981ms
9:09:11 AM: Starting to fetch data from Prismic
9:09:11 AM: Fetch Prismic data: 217.053ms
9:09:11 AM: success source and transform nodes - 3.648s
9:09:11 AM: success building schema - 0.573s
9:09:11 AM: success createPages - 0.080s
9:09:12 AM: success createPagesStatefully - 0.100s
9:09:12 AM: success onPreExtractQueries - 0.001s
9:09:12 AM: success update schema - 0.026s
9:09:12 AM: success extract queries from components - 0.522s
9:09:12 AM: success write out requires - 0.003s
9:09:12 AM: success write out redirect data - 0.001s
9:09:12 AM: success Build manifest and related icons - 0.113s
9:09:12 AM: success onPostBootstrap - 0.115s
9:09:12 AM: ⠀
9:09:12 AM: info bootstrap finished - 9.072 s
9:09:12 AM: ⠀
9:09:34 AM: failed Building production JavaScript and CSS bundles - 21.114s
9:09:34 AM: error Generating JavaScript bundles failed
9:09:34 AM: Can't resolve 'gatsby-link' in '/opt/build/repo/.cache'
9:09:34 AM: error Generating JavaScript bundles failed
9:09:34 AM: Can't resolve 'gatsby-link' in '/opt/build/repo/.cache'
9:09:34 AM: error Generating JavaScript bundles failed
9:09:34 AM: Can't resolve 'gatsby-react-router-scroll' in '/opt/build/repo/.cache'
9:09:34 AM: not finished run queries - 21.564s
9:09:34 AM: not finished Generating image thumbnails - 21.538s
9:09:34 AM: Skipping functions preparation step: no functions directory set
9:09:34 AM: Caching artifacts
9:09:34 AM: Started saving node modules
9:09:34 AM: Finished saving node modules
9:09:34 AM: Started saving yarn cache
9:09:34 AM: Finished saving yarn cache
9:09:34 AM: Started saving pip cache
9:09:34 AM: Finished saving pip cache
9:09:34 AM: Started saving emacs cask dependencies
9:09:34 AM: Finished saving emacs cask dependencies
9:09:34 AM: Started saving maven dependencies
9:09:34 AM: Finished saving maven dependencies
9:09:34 AM: Started saving boot dependencies
9:09:34 AM: Finished saving boot dependencies
9:09:34 AM: Started saving go dependencies
9:09:34 AM: failed during stage 'building site': Build script returned non-zero exit code: 1
9:09:34 AM: Finished saving go dependencies
9:09:34 AM: Error running command: Build script returned non-zero exit code: 1
9:09:34 AM: Failing build: Failed to build site
9:09:34 AM: Finished processing build request in 1m54.671584546s

```

---

<div class="post-metadata">

**Author:** ![millymilly](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/millymilly/32/8643_2.png) [@millymilly](https://answers.netlify.com/u/millymilly)\
**Post date:** [February 12, 2020, 11:18am UTC](https://answers.netlify.com/t/build-script-returned-non-zero-exit-code-1/8777/8 "2020-02-12T11:18:19Z")

</div>

Hi, I am running into the exact same issue and error code. It just stopped working randomly yesterday. There are no breaking changes in my code. Build works fine locally, but it fails on Netlify. I cleared the cache and retried, didn’t work. Updated my packages, didn’t work. My client can’t use his application now… I can’t seem to solve it myself or find any help ☹

It seems as if this is some kind of bug because both our deployments failed yesterday without reason?

Edit: I found the solution. I updated yarn and all peer dependencies that were missing; deleted my cache (public folder, node\_modules folder, .cache folder) and the yarn.lock, ran yarn install once again, pushed all changes and the site finally deployed just fine.

---

<div class="post-metadata">

**Author:** ![perry](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/perry/32/16_2.png) [@perry](https://answers.netlify.com/u/perry)\
**Post date:** [February 12, 2020, 5:03pm UTC](https://answers.netlify.com/t/build-script-returned-non-zero-exit-code-1/8777/9 "2020-02-12T17:03:12Z")

</div>

thanks for sharing your solution, @millymilly! @andrwrbnsn - are you able to get things working with what @millymilly suggested?

---

<div class="post-metadata">

**Author:** ![andrwrbnsn](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/andrwrbnsn/32/1381_2.png) [@andrwrbnsn](https://answers.netlify.com/u/andrwrbnsn)\
**Post date:** [February 12, 2020, 5:21pm UTC](https://answers.netlify.com/t/build-script-returned-non-zero-exit-code-1/8777/10 "2020-02-12T17:21:44Z")

</div>

Thanks @millymilly — this looks like it has worked so far, thank-you for everyone’s help on getting this working again!

---

<div class="post-metadata">

**Author:** ![Lucascoorek](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/lucascoorek/32/8630_2.png) [@Lucascoorek](https://answers.netlify.com/u/Lucascoorek)\
**Post date:** [April 2, 2020, 4:58am UTC](https://answers.netlify.com/t/build-script-returned-non-zero-exit-code-1/8777/11 "2020-04-02T04:58:15Z")

</div>

Hi, having the same issue. Following @millymilly didn’t help.  
Can you tell what is my main problem?

6:56:08 AM: No cached dependencies found. Cloning fresh repo  
6:56:08 AM: git clone [https://github.com/Lucascoorek/proste-strony](https://github.com/Lucascoorek/proste-strony)  
6:55:57 AM: Build ready to start  
6:56:07 AM: build-image version: 2dbd444fcdce00cf06325060a8238d5ae3e86774  
6:56:07 AM: build-image tag: v3.3.7  
6:56:07 AM: buildbot version: bd31cf433d2d899021d41733f271c39fdf2f8880  
6:56:07 AM: Fetching cached dependencies  
6:56:07 AM: Failed to fetch cache, continuing with build  
6:56:07 AM: Starting to prepare the repo for build  
6:56:09 AM: Preparing Git Reference refs/heads/master  
6:56:09 AM: Starting build script  
6:56:09 AM: Installing dependencies  
6:56:10 AM: v10.19.0 is already installed.  
6:56:11 AM: Now using node v10.19.0 (npm v6.13.4)  
6:56:11 AM: Attempting ruby version 2.6.2, read from environment  
6:56:13 AM: Using ruby version 2.6.2  
6:56:13 AM: Using PHP version 5.6  
6:56:13 AM: Started restoring cached node modules  
6:56:13 AM: Finished restoring cached node modules  
6:56:13 AM: Started restoring cached yarn cache  
6:56:13 AM: Finished restoring cached yarn cache  
6:56:13 AM: Installing yarn at version 1.17.0  
6:56:13 AM: Installing Yarn!  
6:56:13 AM: \> Downloading tarball…  
6:56:13 AM: [  
6:56:13 AM: 1  
6:56:13 AM: /  
6:56:13 AM: 2  
6:56:13 AM: ]  
6:56:13 AM: :  
6:56:13 AM: h  
6:56:13 AM: t  
6:56:13 AM: t  
6:56:13 AM: p  
6:56:13 AM: s  
6:56:13 AM: :  
6:56:13 AM: /  
6:56:13 AM: /  
6:56:13 AM: y  
6:56:13 AM: a  
6:56:13 AM: r  
6:56:13 AM: n  
6:56:13 AM: p  
6:56:13 AM: k  
6:56:13 AM: g  
6:56:13 AM: .  
6:56:13 AM: c  
6:56:13 AM: o  
6:56:13 AM: m  
6:56:13 AM: /  
6:56:13 AM: d  
6:56:13 AM: o  
6:56:13 AM: w  
6:56:13 AM: n  
6:56:13 AM: l  
6:56:13 AM: o  
6:56:13 AM: a  
6:56:13 AM: d  
6:56:13 AM: s  
6:56:13 AM: /  
6:56:13 AM: 1  
6:56:13 AM: .17.0/yarn-v1.17.0.tar.gz → /tmp/yarn.tar.gz.6c7AsoXKkw  
6:56:13 AM: % Total % Received % Xferd Average Speed Time Time Time Current  
6:56:13 AM: Dload Upload Total Spent Left Speed  
6:56:13 AM:  
0 0 0 0 0 0 0 0 --:–:-- --:–:-- -  
6:56:13 AM: -:–:-- 0  
6:56:13 AM:  
100 80 100 80 0 0 246 0 --:–:-- --:–:-- --:–:-- 246  
6:56:14 AM:  
100 93 100 93  
6:56:14 AM: 0 0 144 0 --:–:-- --:–:-- --:–:-- 144  
6:56:14 AM:  
0 0 0 0 0 0  
6:56:14 AM: 0 0 --:–:-- 0:00:01 --:–:-- 0  
100 609 100 609 0 0 491 0 0:00:01 0:00:01 --:–:-- 594k  
6:56:15 AM:  
100 1213k 100 1213k 0 0 709k 0 0:00:01 0  
6:56:15 AM: :00:01 --:–:-- 709k  
6:56:15 AM: [2/2]: [https://yarnpkg.com/dow](https://yarnpkg.com/dow)  
6:56:15 AM: nloads/1.17.0/yarn-v1.17.0.tar.gz.asc → /tmp/yarn.tar.gz.6c7AsoXKkw.asc  
6:56:15 AM:  
100 84 100 84  
6:56:15 AM: 0 0 3040 0 --:–:-- --:–:-- --:–:-- 3040  
6:56:15 AM:  
100 97 100 97 0 0 1  
6:56:15 AM: 764 0 --:–:-- --:–:-- --:–:-- 1764  
6:56:15 AM:  
100 613 100 613 0 0 2817 0 --:–:–  
6:56:15 AM: --:–:-- --:–:-- 2817  
6:56:15 AM:  
0 832 0 0 0 0 0  
6:56:15 AM: 0 --:–:-- --:–:-- --:–:-- 0  
100 832 100 832 0 0 2509 0 --:–:-- --:–:-- --:–:-- 812k  
6:56:15 AM: \> Verifying integrity…  
6:56:15 AM: gpg: Signature made Fri 14 Jun 2019 06:55:58 PM UTC using RSA key ID 69475BAA  
6:56:15 AM: gpg: Good signature from “Yarn Packaging [yarn@dan.cx](mailto:yarn@dan.cx)”  
6:56:15 AM: gpg: WARNING: This key is not certified with a trusted signature!  
6:56:15 AM: gpg: There is no indication that the signature belongs to the owner.  
6:56:15 AM: Primary key fingerprint: 72EC F46A 56B4 AD39 C907 BBB7 1646 B01B 86E5 0310  
6:56:15 AM: Subkey fingerprint: 6D98 490C 6F1A CDDD 448E 4595 4F77 6793 6947 5BAA  
6:56:15 AM: \> GPG signature looks good  
6:56:15 AM: \> Extracting to ~/.yarn…  
6:56:15 AM: \> Adding to $PATH…  
6:56:16 AM: \> Successfully installed Yarn 1.17.0! Please open another terminal where the `yarn` command will now be available.  
6:56:16 AM: Installing NPM modules using Yarn version 1.17.0  
6:56:17 AM: yarn install v1.17.0  
6:56:17 AM: [1/5] Validating package.json…  
6:56:17 AM: warning gatsby-starter-ts-hello-world@1.0.0: The engine “vscode” appears to be invalid.  
6:56:17 AM: [2/5] Resolving packages…  
6:56:18 AM: [3/5] Fetching packages…  
6:56:40 AM: info fsevents@2.1.2: The platform “linux” is incompatible with this module.  
6:56:40 AM: info “fsevents@2.1.2” is an optional dependency and failed compatibility check. Excluding it from installation.  
6:56:40 AM: info fsevents@1.2.12: The platform “linux” is incompatible with this module.  
6:56:40 AM: info “fsevents@1.2.12” is an optional dependency and failed compatibility check. Excluding it from installation.  
6:56:40 AM: [4/5] Linking dependencies…  
6:56:40 AM: warning “gatsby-plugin-sass \> sass-loader@7.3.1” has unmet peer dependency “webpack@^3.0.0 || ^4.0.0”.  
6:56:50 AM: [5/5] Building fresh packages…  
6:56:53 AM: success Saved lockfile.  
6:56:53 AM: Done in 36.19s.  
6:56:53 AM: NPM modules installed using Yarn  
6:56:53 AM: Started restoring cached go cache  
6:56:53 AM: Finished restoring cached go cache  
6:56:54 AM: unset GOOS;  
6:56:54 AM: unset GOARCH;  
6:56:54 AM: export GOROOT=‘/opt/buildhome/.gimme/versions/go1.12.linux.amd64’;  
6:56:54 AM: export PATH=“/opt/buildhome/.gimme/versions/go1.12.linux.amd64/bin:${PATH}”;  
6:56:54 AM: go version \>&2;  
6:56:54 AM: export GIMME\_ENV=‘/opt/buildhome/.gimme/env/go1.12.linux.amd64.env’;  
6:56:54 AM: go version go1.12 linux/amd64  
6:56:54 AM: Installing missing commands  
6:56:54 AM: Verify run directory  
6:56:54 AM: Executing user command: gatsby build  
6:56:56 AM: success open and validate gatsby-configs - 0.025s  
6:56:56 AM: success load plugins - 0.394s  
6:56:56 AM: success onPreInit - 0.003s  
6:56:56 AM: success delete html and css files from previous builds - 0.021s  
6:56:56 AM: success initialize cache - 0.019s  
6:56:56 AM: success copy gatsby files - 0.050s  
6:56:56 AM: success onPreBootstrap - 0.020s  
6:56:56 AM: success createSchemaCustomization - 0.007s  
6:56:56 AM: success source and transform nodes - 0.076s  
6:56:56 AM: success building schema - 0.262s  
6:56:56 AM: success createPages - 0.033s  
6:56:56 AM: success createPagesStatefully - 0.077s  
6:56:56 AM: success onPreExtractQueries - 0.000s  
6:56:57 AM: success update schema - 0.031s  
6:56:57 AM: success extract queries from components - 0.131s  
6:56:57 AM: success write out requires - 0.003s  
6:56:57 AM: success write out redirect data - 0.001s  
6:56:57 AM: success onPostBootstrap - 0.000s  
6:56:57 AM: ⠀  
6:56:57 AM: info bootstrap finished - 3.125 s  
6:56:57 AM: ⠀  
6:57:11 AM: warning chunk styles [mini-css-extract-plugin]  
6:57:11 AM: Conflicting order. Following module has been added:  
6:57:11 AM: \* css ./node\_modules/css-loader??ref–14-oneOf-1-1!./node\_modules/postcss-loader/src??postcss-3!./node\_modules/sass-loader/dist/cjs.js??ref–14-oneOf-1-3!./node\_modules/sass-resources-loader/lib/loader.js??ref–15!./src/styles/reset.scss  
6:57:11 AM: despite it was not able to fulfill desired ordering with these modules:  
6:57:11 AM: \* css ./node\_modules/css-loader??ref–14-oneOf-0-1!./node\_modules/postcss-loader/src??postcss-4!./node\_modules/sass-loader/dist/cjs.js??ref–14-oneOf-0-3!./node\_modules/sass-resources-loader/lib/loader.js??ref–15!./src/components/footer/footer.module.scss  
6:57:11 AM: - couldn’t fulfill desired order of chunk group(s) component—src-templates-usluga-tsx  
6:57:11 AM: - while fulfilling desired order of chunk group(s) component—src-pages-404-tsx, component—src-pages-index-tsx, component—src-pages-kontakt-tsx, component—src-pages-uslugi-tsx  
6:57:11 AM: \* css ./node\_modules/css-loader??ref–14-oneOf-0-1!./node\_modules/postcss-loader/src??postcss-4!./node\_modules/sass-loader/dist/cjs.js??ref–14-oneOf-0-3!./node\_modules/sass-resources-loader/lib/loader.js??ref–15!./src/components/navbar/navbar.module.scss  
6:57:11 AM: - couldn’t fulfill desired order of chunk group(s) component—src-templates-usluga-tsx  
6:57:11 AM: - while fulfilling desired order of chunk group(s) component—src-pages-404-tsx, component—src-pages-index-tsx, component—src-pages-kontakt-tsx, component—src-pages-uslugi-tsx  
6:57:11 AM: warning chunk styles [mini-css-extract-plugin]  
6:57:11 AM: Conflicting order. Following module has been added:  
6:57:11 AM: \* css ./node\_modules/css-loader??ref–14-oneOf-0-1!./node\_modules/postcss-loader/src??postcss-4!./node\_modules/sass-loader/dist/cjs.js??ref–14-oneOf-0-3!./node\_modules/sass-resources-loader/lib/loader.js??ref–15!./src/components/navbar/navbar.module.scss  
6:57:11 AM: despite it was not able to fulfill desired ordering with these modules:  
6:57:11 AM: \* css ./node\_modules/css-loader??ref–14-oneOf-1-1!./node\_modules/postcss-loader/src??postcss-3!./node\_modules/sass-loader/dist/cjs.js??ref–14-oneOf-1-3!./node\_modules/sass-resources-loader/lib/loader.js??ref–15!./src/styles/index.scss (1)  
6:57:11 AM: - couldn’t fulfill desired order of chunk group(s) component—src-pages-404-tsx, component—src-pages-index-tsx, component—src-pages-kontakt-tsx, component—src-pages-uslugi-tsx  
6:57:11 AM: - while fulfilling desired order of chunk group(s) component—src-templates-usluga-tsx  
6:57:11 AM: \* css ./node\_modules/css-loader??ref–14-oneOf-1-1!./node\_modules/postcss-loader/src??postcss-3!./node\_modules/sass-loader/dist/cjs.js??ref–14-oneOf-1-3!./node\_modules/sass-resources-loader/lib/loader.js??ref–15!./src/styles/index.scss  
6:57:11 AM: - couldn’t fulfill desired order of chunk group(s) component—src-pages-404-tsx, component—src-pages-index-tsx, component—src-pages-kontakt-tsx, component—src-pages-uslugi-tsx  
6:57:11 AM: - while fulfilling desired order of chunk group(s) component—src-templates-usluga-tsx  
6:57:11 AM: warning chunk styles [mini-css-extract-plugin]  
6:57:11 AM: Conflicting order. Following module has been added:  
6:57:11 AM: \* css ./node\_modules/css-loader??ref–14-oneOf-1-1!./node\_modules/postcss-loader/src??postcss-3!./node\_modules/sass-loader/dist/cjs.js??ref–14-oneOf-1-3!./node\_modules/sass-resources-loader/lib/loader.js??ref–15!./src/styles/index.scss  
6:57:11 AM: despite it was not able to fulfill desired ordering with these modules:  
6:57:11 AM: \* css ./node\_modules/css-loader??ref–14-oneOf-0-1!./node\_modules/postcss-loader/src??postcss-4!./node\_modules/sass-loader/dist/cjs.js??ref–14-oneOf-0-3!./node\_modules/sass-resources-loader/lib/loader.js??ref–15!./src/components/footer/footer.module.scss  
6:57:11 AM: - couldn’t fulfill desired order of chunk group(s) component—src-templates-usluga-tsx  
6:57:11 AM: - while fulfilling desired order of chunk group(s) component—src-pages-404-tsx, component—src-pages-index-tsx, component—src-pages-kontakt-tsx, component—src-pages-uslugi-tsx  
6:57:11 AM: warning chunk styles [mini-css-extract-plugin]  
6:57:11 AM: Conflicting order. Following module has been added:  
6:57:11 AM: \* css ./node\_modules/css-loader??ref–14-oneOf-0-1!./node\_modules/postcss-loader/src??postcss-4!./node\_modules/sass-loader/dist/cjs.js??ref–14-oneOf-0-3!./node\_modules/sass-resources-loader/lib/loader.js??ref–15!./src/components/footer/footer.module.scss  
6:57:11 AM: despite it was not able to fulfill desired ordering with these modules:  
6:57:11 AM: \* css ./node\_modules/css-loader??ref–14-oneOf-1-1!./node\_modules/postcss-loader/src??postcss-3!./node\_modules/sass-loader/dist/cjs.js??ref–14-oneOf-1-3!./node\_modules/sass-resources-loader/lib/loader.js??ref–15!./src/styles/index.scss (1)  
6:57:11 AM: - couldn’t fulfill desired order of chunk group(s) component—src-pages-404-tsx, component—src-pages-index-tsx, component—src-pages-kontakt-tsx, component—src-pages-uslugi-tsx  
6:57:11 AM: - while fulfilling desired order of chunk group(s) component—src-templates-usluga-tsx  
6:57:11 AM: failed Building production JavaScript and CSS bundles - 13.903s  
6:57:11 AM: error Generating JavaScript bundles failed  
6:57:11 AM: Can’t resolve ‘./logoIcon’ in ‘/opt/build/repo/src/components/icons’  
6:57:11 AM: not finished run queries - 13.917s  
6:57:11 AM: Skipping functions preparation step: no functions directory set  
6:57:11 AM: Caching artifacts  
6:57:11 AM: Started saving node modules  
6:57:11 AM: Finished saving node modules  
6:57:11 AM: Started saving yarn cache  
6:57:11 AM: Finished saving yarn cache  
6:57:11 AM: Started saving pip cache  
6:57:11 AM: Finished saving pip cache  
6:57:11 AM: Started saving emacs cask dependencies  
6:57:11 AM: Finished saving emacs cask dependencies  
6:57:11 AM: Started saving maven dependencies  
6:57:11 AM: Finished saving maven dependencies  
6:57:11 AM: Started saving boot dependencies  
6:57:11 AM: Finished saving boot dependencies  
6:57:11 AM: Started saving go dependencies  
6:57:11 AM: Finished saving go dependencies  
6:57:14 AM: Error running command: Build script returned non-zero exit code: 1  
6:57:14 AM: Failing build: Failed to build site  
6:57:14 AM: failed during stage ‘building site’: Build script returned non-zero exit code: 1  
6:57:14 AM: Finished processing build request in 1m7.551389893s

---

<div class="post-metadata">

**Author:** ![millymilly](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/millymilly/32/8643_2.png) [@millymilly](https://answers.netlify.com/u/millymilly)\
**Post date:** [April 2, 2020, 11:39am UTC](https://answers.netlify.com/t/build-script-returned-non-zero-exit-code-1/8777/12 "2020-04-02T11:39:48Z")

</div>

> [@Lucascoorek](#):
>
> 6:57:11 AM: error Generating JavaScript bundles failed  
> 6:57:11 AM: Can’t resolve ‘./logoIcon’ in ‘/opt/build/repo/src/components/icons’

Looks like there’s a file which can’t be resolved. 🙂 Have you added logoIcon to ‘/opt/build/repo/src/components/icons’? Seems like it’s missing.

---

<div class="post-metadata">

**Author:** ![Lucascoorek](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/lucascoorek/32/8630_2.png) [@Lucascoorek](https://answers.netlify.com/u/Lucascoorek)\
**Post date:** [April 2, 2020, 3:54pm UTC](https://answers.netlify.com/t/build-script-returned-non-zero-exit-code-1/8777/13 "2020-04-02T15:54:22Z")

</div>

Thank you @millymilly, you were right. That helped. There is something wrong with my svg file. It’s working on my local build but somehow Netlify build differes.

---

<div class="post-metadata">

**Author:** ![perry](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/perry/32/16_2.png) [@perry](https://answers.netlify.com/u/perry)\
**Post date:** [April 2, 2020, 3:58pm UTC](https://answers.netlify.com/t/build-script-returned-non-zero-exit-code-1/8777/14 "2020-04-02T15:58:18Z")

</div>

hey lucas, i wonder if this is helpful:

> [@\[Support Guide\] Netlify app builds locally but fails on deploy (case sensitivity)](https://answers.netlify.com/t/common-issue-problems-with-case-sensitivity-while-building-on-netlify/10754):
>
> Last updated by Netlify Support: July 2025 Are you struggling to understand why your project runs locally but errors out with missing files or logs that point toward issues with case when you try and build on Netlify? You are not alone. Often, case (as in: UPPERCASE or lowercase letters in filenames or paths) can cause problems. Here is a guide to understanding how case sensitivity issues present themselves, why they arise, and how you can fix them! 1. Errors you might see Case sensitivity iss…

---

<div class="post-metadata">

**Author:** ![rollrodrig](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/rollrodrig/32/9989_2.png) [@rollrodrig](https://answers.netlify.com/u/rollrodrig)\
**Post date:** [April 29, 2020, 1:25am UTC](https://answers.netlify.com/t/build-script-returned-non-zero-exit-code-1/8777/15 "2020-04-29T01:25:05Z")

</div>

I had the same problem. Local build worked but not netlify building. The problem was file name. Pay attention to your filename. I was named a file NavBar and imported as ./navbar  
on local works but not on remote.

---

<div class="post-metadata">

**Author:** ![Dmendez49](https://avatars.discourse-cdn.com/v4/letter/d/a587f6/32.png) [@Dmendez49](https://answers.netlify.com/u/Dmendez49)\
**Post date:** [June 21, 2020, 1:24pm UTC](https://answers.netlify.com/t/build-script-returned-non-zero-exit-code-1/8777/16 "2020-06-21T13:24:03Z")

</div>

Hello @millymilly I came across this issue and tried to troubleshoot this issue. I came across your post and tried the following steps. I’m still having challenges maybe you can review my issue. Here is my logs.

```
indent preformatted text by 4 spaces

```

7:21:48 AM: Build ready to start  
7:21:49 AM: build-image version: 3031d4c9e432fd7016f6279fc9ad706f9205d845  
7:21:49 AM: build-image tag: v3.3.17  
7:21:49 AM: buildbot version: da42b14a989873e00cc6f36bc354c01953474181  
7:21:50 AM: Fetching cached dependencies  
7:21:50 AM: Starting to download cache of 254.3KB  
7:21:50 AM: Finished downloading cache in 68.534153ms  
7:21:50 AM: Starting to extract cache  
7:21:50 AM: Failed to fetch cache, continuing with build  
7:21:50 AM: Starting to prepare the repo for build  
7:21:50 AM: No cached dependencies found. Cloning fresh repo  
7:21:50 AM: git clone [https://github.com/DMendez49/profile](https://github.com/DMendez49/profile)  
7:21:56 AM: Preparing Git Reference refs/heads/master  
7:21:58 AM: Different publish path detected, going to use the one specified in the Netlify configuration file: ‘build’ versus ‘build/’ in the Netlify UI  
7:21:58 AM: Starting build script  
7:21:58 AM: Installing dependencies  
7:21:58 AM: Python version set to 2.7  
7:21:59 AM: v12.18.0 is already installed.  
7:22:00 AM: Now using node v12.18.0 (npm v6.14.4)  
7:22:00 AM: Started restoring cached build plugins  
7:22:00 AM: Finished restoring cached build plugins  
7:22:00 AM: Attempting ruby version 2.7.1, read from environment  
7:22:01 AM: Using ruby version 2.7.1  
7:22:01 AM: Using PHP version 5.6  
7:22:01 AM: 5.2 is already installed.  
7:22:01 AM: Using Swift version 5.2  
7:22:01 AM: Started restoring cached node modules  
7:22:01 AM: Finished restoring cached node modules  
7:22:01 AM: Started restoring cached yarn cache  
7:22:01 AM: Finished restoring cached yarn cache  
7:22:01 AM: Installing yarn at version 1.22.4  
7:22:01 AM: Installing Yarn!  
7:22:01 AM: \> Downloading tarball…  
7:22:01 AM: [1/2]: [https://yarnpkg.com/downloads/1.22.4/yarn-v1.22.4.tar.gz](https://yarnpkg.com/downloads/1.22.4/yarn-v1.22.4.tar.gz) → /tmp/yarn.tar.gz.4VQzt8Hz4U  
7:22:01 AM: % Total % Received % Xferd Average Speed Time Time Time Current  
7:22:01 AM: Dload Upload Total Spent Left Speed  
7:22:02 AM: 0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0  
7:22:02 AM: 0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0  
7:22:02 AM: 100 80 100 80 0 0 286 0 --:–:-- --:–:-- --:–:-- 285  
7:22:02 AM: 100 93 100 93 0 0 154 0 --:–:-- --:–:-- --:–:-- 154  
7:22:02 AM: 100 630 100 630 0 0 614 0 0:00:01 0:00:01 --:–:-- 614  
7:22:03 AM: 0 1215k 0 0 0 0 0 0 --:–:-- 0:00:01 --:–:-- 0  
7:22:03 AM: 100 1215k 100 1215k 0 0 826k 0 0:00:01 0:00:01 --:–:-- 7235k  
7:22:03 AM: [2/2]: [https://yarnpkg.com/downloads/1.22.4/yarn-v1.22.4.tar.gz.asc](https://yarnpkg.com/downloads/1.22.4/yarn-v1.22.4.tar.gz.asc) → /tmp/yarn.tar.gz.4VQzt8Hz4U.asc  
7:22:03 AM: 100 84 100 84 0 0 3023 0 --:–:-- --:–:-- --:–:-- 3023  
7:22:03 AM: 100 97 100 97 0 0 1756 0 --:–:-- --:–:-- --:–:-- 1756  
7:22:03 AM: 100 634 100 634 0 0 3187 0 --:–:-- --:–:-- --:–:-- 3187  
7:22:03 AM: 100 1028 100 1028 0 0 4358 0 --:–:-- --:–:-- --:–:-- 4358  
7:22:03 AM: \> Verifying integrity…  
7:22:03 AM: gpg: Signature made Mon 09 Mar 2020 03:52:13 PM UTC using RSA key ID 69475BAA  
7:22:03 AM: gpg: Good signature from “Yarn Packaging [yarn@dan.cx](mailto:yarn@dan.cx)”  
7:22:03 AM: gpg: WARNING: This key is not certified with a trusted signature!  
7:22:03 AM: gpg: There is no indication that the signature belongs to the owner.  
7:22:03 AM: Primary key fingerprint: 72EC F46A 56B4 AD39 C907 BBB7 1646 B01B 86E5 0310  
7:22:03 AM: Subkey fingerprint: 6D98 490C 6F1A CDDD 448E 4595 4F77 6793 6947 5BAA  
7:22:03 AM: \> GPG signature looks good  
7:22:03 AM: \> Extracting to ~/.yarn…  
7:22:03 AM: \> Adding to $PATH…  
7:22:04 AM: \> Successfully installed Yarn 1.22.4! Please open another terminal where the `yarn` command will now be available.  
7:22:04 AM: Installing NPM modules using Yarn version 1.22.4  
7:22:04 AM: yarn install v1.22.4  
7:22:05 AM: [1/4] Resolving packages…  
7:22:05 AM: [2/4] Fetching packages…  
7:22:24 AM: info fsevents@2.1.2: The platform “linux” is incompatible with this module.  
7:22:24 AM: info “fsevents@2.1.2” is an optional dependency and failed compatibility check. Excluding it from installation.  
7:22:24 AM: info fsevents@1.2.13: The platform “linux” is incompatible with this module.  
7:22:24 AM: info “fsevents@1.2.13” is an optional dependency and failed compatibility check. Excluding it from installation.  
7:22:24 AM: info fsevents@2.1.3: The platform “linux” is incompatible with this module.  
7:22:24 AM: info “fsevents@2.1.3” is an optional dependency and failed compatibility check. Excluding it from installation.  
7:22:24 AM: [3/4] Linking dependencies…  
7:22:24 AM: warning " \> @testing-library/user-event@7.2.1" has unmet peer dependency “@testing-library/dom@\>=5”.  
7:22:24 AM: warning “react-scripts \> @typescript-eslint/eslint-plugin \> tsutils@3.17.1” has unmet peer dependency “typescript@\>=2.8.0 || \>= 3.2.0-dev || \>= 3.3.0-dev || \>= 3.4.0-dev || \>= 3.5.0-dev || \>= 3.6.0-dev || \>= 3.6.0-beta || \>= 3.7.0-dev || \>= 3.7.0-beta”.  
7:22:35 AM: [4/4] Building fresh packages…  
7:22:36 AM: Done in 31.97s.  
7:22:36 AM: NPM modules installed using Yarn  
7:22:37 AM: Started restoring cached go cache  
7:22:37 AM: Finished restoring cached go cache  
7:22:37 AM: go version go1.14.4 linux/amd64  
7:22:37 AM: go version go1.14.4 linux/amd64  
7:22:37 AM: Installing missing commands  
7:22:37 AM: Verify run directory  
7:22:38 AM: ​  
7:22:38 AM: ┌─────────────────────────────┐  
7:22:38 AM: │ Netlify Build │  
7:22:38 AM: └─────────────────────────────┘  
7:22:38 AM: ​  
7:22:38 AM: ❯ Version  
7:22:38 AM: @netlify/build 2.0.10  
7:22:38 AM: ​  
7:22:38 AM: ❯ Flags  
7:22:38 AM: deployId: 5eef5eebe9fafe389e9062ca  
7:22:38 AM: mode: buildbot  
7:22:38 AM: ​  
7:22:38 AM: ❯ Current directory  
7:22:38 AM: /opt/build/repo  
7:22:38 AM: ​  
7:22:38 AM: ❯ Config file  
7:22:38 AM: No config file was defined: using default values.  
7:22:38 AM: ​  
7:22:38 AM: ❯ Context  
7:22:38 AM: production  
7:22:38 AM: ​  
7:22:38 AM: ┌────────────────────────────────┐  
7:22:38 AM: │ 1. Build command from settings │  
7:22:38 AM: └────────────────────────────────┘  
7:22:38 AM: ​  
7:22:38 AM: $ yarn build  
7:22:38 AM: yarn run v1.22.4  
7:22:38 AM: $ react-scripts build  
7:22:39 AM: Could not find a required file.  
7:22:39 AM: Name: index.html  
7:22:39 AM: Searched in: /opt/build/repo/public  
7:22:39 AM: error Command failed with exit code 1.  
7:22:39 AM: info Visit [yarn run | Yarn](https://yarnpkg.com/en/docs/cli/run) for documentation about this command.  
7:22:39 AM: ​  
7:22:39 AM: ┌─────────────────────────────┐  
7:22:39 AM: │ “build.command” failed │  
7:22:39 AM: └─────────────────────────────┘  
7:22:39 AM: ​  
7:22:39 AM: Error message  
7:22:39 AM: Command failed with exit code 1: yarn build  
7:22:39 AM: ​  
7:22:39 AM: Error location  
7:22:39 AM: In Build command from settings:  
7:22:39 AM: yarn build  
7:22:39 AM: ​  
7:22:39 AM: Resolved config  
7:22:39 AM: build:  
7:22:39 AM: command: yarn build  
7:22:39 AM: publish: /opt/build/repo/build  
7:22:39 AM: Caching artifacts  
7:22:39 AM: Started saving node modules  
7:22:39 AM: Finished saving node modules  
7:22:39 AM: Started saving build plugins  
7:22:39 AM: Finished saving build plugins  
7:22:39 AM: Started saving yarn cache  
7:22:39 AM: Finished saving yarn cache  
7:22:39 AM: Started saving pip cache  
7:22:40 AM: Finished saving pip cache  
7:22:40 AM: Started saving emacs cask dependencies  
7:22:40 AM: Finished saving emacs cask dependencies  
7:22:40 AM: Started saving maven dependencies  
7:22:40 AM: Finished saving maven dependencies  
7:22:40 AM: Started saving boot dependencies  
7:22:40 AM: Finished saving boot dependencies  
7:22:40 AM: Started saving go dependencies  
7:22:40 AM: Finished saving go dependencies  
7:22:42 AM: Error running command: Build script returned non-zero exit code: 1  
7:22:42 AM: Failing build: Failed to build site  
7:22:42 AM: Failed during stage ‘building site’: Build script returned non-zero exit code: 1  
7:22:42 AM: Finished processing build request in 52.991650107s

---

<div class="post-metadata">

**Author:** ![luke](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/luke/32/39_2.png) [@luke](https://answers.netlify.com/u/luke)\
**Post date:** [June 23, 2020, 1:00pm UTC](https://answers.netlify.com/t/build-script-returned-non-zero-exit-code-1/8777/17 "2020-06-23T13:00:49Z")

</div>

Hi, @Dmendez49, there was an error in the build as logged here:

```nohighlight
7:22:38 AM: $ react-scripts build
7:22:39 AM: Could not find a required file.
7:22:39 AM: Name: index.html
7:22:39 AM: Searched in: /opt/build/repo/public
7:22:39 AM: error Command failed with exit code 1.

```

Is the file `index.html` present? Also, does the case in your site code match the case on the local filesystem? By case, I mean does the site code say “index.html” but the file itself is actually named “Index.html” with a capital “I”? The build system is Linux and the case of the filenames must match exactly on most Linux systems (and definitely on our build system).

That is just one possibility but a good place to check first.

---

<div class="post-metadata">

**Author:** ![hariharanmh001](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/hariharanmh001/32/23693_2.png) [@hariharanmh001](https://answers.netlify.com/u/hariharanmh001)\
**Post date:** [June 22, 2021, 10:48am UTC](https://answers.netlify.com/t/build-script-returned-non-zero-exit-code-1/8777/18 "2021-06-22T10:48:02Z")

</div>

Hi Milly, thanks for your solution, I have tried the same and updated my yarn.lock file as you mentioned. now my doubt is if I click clear cache and deploy site will my last stable version of the site available in live or not because we are clearing the cache,  
sorry if it was a lame question

---

<div class="post-metadata">

**Author:** ![hillary](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/hillary/32/21132_2.png) [@hillary](https://answers.netlify.com/u/hillary)\
**Post date:** [June 23, 2021, 10:08pm UTC](https://answers.netlify.com/t/build-script-returned-non-zero-exit-code-1/8777/19 "2021-06-23T22:08:39Z")

</div>

Hi there, @hariharanmh001 👋

We have a lot of great resources about caching! I recommend starting with this article:

> **[Better Living Through Caching](https://www.netlify.com/blog/2017/02/23/better-living-through-caching/)**
>
> Learn about the ins and outs of caching at Netlify.

---

<div class="post-metadata">

**Author:** ![JosephAddant](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/josephaddant/32/43908_2.png) [@JosephAddant](https://answers.netlify.com/u/JosephAddant)\
**Post date:** [December 16, 2022, 9:41am UTC](https://answers.netlify.com/t/build-script-returned-non-zero-exit-code-1/8777/20 "2022-12-16T09:41:44Z")

</div>

i have the same problem witht he deployment, i tried to understand what is wrong and i haven’t been using any yarn files. so i couldn’t use @millymilly answer and i want to know that if any one can tell me the problem.

i tried reating a new repo and also revoking the authentication twice. Nothing helps.

Here’s the deploy error.

2:55:08 PM: build-image version: 524714d1a66d1a967316f5c39465e22c77fdd56c (focal)  
2:55:08 PM: build-image tag: v4.16.0  
2:55:08 PM: buildbot version: 2956156cff73cc91029b26e56f43b4bf895eefff  
2:55:09 PM: Fetching cached dependencies  
2:55:09 PM: Failed to fetch cache, continuing with build  
2:55:09 PM: Starting to prepare the repo for build  
2:55:09 PM: No cached dependencies found. Cloning fresh repo  
2:55:09 PM: git clone [https://github.com/JosephAddant/Addant\_Portfolio](https://github.com/JosephAddant/Addant_Portfolio)  
2:55:09 PM: Preparing Git Reference refs/heads/master  
2:55:09 PM: Parsing package.json dependencies  
2:55:10 PM: Section completed: initializing  
2:55:11 PM: Starting build script  
2:55:11 PM: Installing dependencies  
2:55:11 PM: Python version set to 2.7  
2:55:11 PM: Downloading and installing node v16.19.0…  
2:55:11 PM: Downloading [https://nodejs.org/dist/v16.19.0/node-v16.19.0-linux-x64.tar.xz](https://nodejs.org/dist/v16.19.0/node-v16.19.0-linux-x64.tar.xz)…  
2:55:11 PM: Computing checksum with sha256sum  
2:55:12 PM: Checksums matched!  
2:55:14 PM: Now using node v16.19.0 (npm v8.19.3)  
2:55:14 PM: Enabling node corepack  
2:55:14 PM: Started restoring cached build plugins  
2:55:14 PM: Finished restoring cached build plugins  
2:55:14 PM: Attempting ruby version 2.7.2, read from environment  
2:55:15 PM: Using ruby version 2.7.2  
2:55:15 PM: Using PHP version 8.0  
2:55:15 PM: No npm workspaces detected  
2:55:15 PM: Started restoring cached node modules  
2:55:15 PM: Finished restoring cached node modules  
2:55:15 PM: Installing NPM modules using NPM version 8.19.3  
2:55:16 PM: npm WARN ERESOLVE overriding peer dependency  
2:55:16 PM: npm WARN While resolving: react-motion@0.5.2  
2:55:16 PM: npm WARN Found: react@18.2.0  
2:55:16 PM: npm WARN node\_modules/react  
2:55:16 PM: npm WARN react@“^18.2.0” from the root project  
2:55:16 PM: Creating deploy upload records  
2:55:16 PM: npm WARN 3 more (@testing-library/react, react-dom, react-scripts)  
2:55:16 PM: npm WARN  
2:55:16 PM: npm WARN Could not resolve dependency:  
2:55:16 PM: npm WARN peer react@“^0.14.9 || ^15.3.0 || ^16.0.0” from react-motion@0.5.2  
2:55:16 PM: npm WARN node\_modules/react-motion  
2:55:17 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](https://ntl.fyi/exit-code-1))  
2:55:16 PM: npm WARN react-motion@“^0.5.2” from react-scroll-horizontal@1.6.6  
2:55:16 PM: npm WARN node\_modules/react-scroll-horizontal  
2:55:16 PM: npm WARN  
2:55:16 PM: npm WARN Conflicting peer dependency: react@16.14.0  
2:55:16 PM: npm WARN node\_modules/react  
2:55:16 PM: npm WARN peer react@“^0.14.9 || ^15.3.0 || ^16.0.0” from react-motion@0.5.2  
2:55:16 PM: npm WARN node\_modules/react-motion  
2:55:16 PM: npm WARN react-motion@“^0.5.2” from react-scroll-horizontal@1.6.6  
2:55:16 PM: npm WARN node\_modules/react-scroll-horizontal  
2:55:16 PM: npm ERR! code ERESOLVE  
2:55:16 PM: npm ERR! ERESOLVE could not resolve  
2:55:16 PM: npm ERR!  
2:55:16 PM: npm ERR! While resolving: react-scroll-horizontal@1.6.6  
2:55:16 PM: npm ERR! Found: react@18.2.0  
2:55:16 PM: npm ERR! node\_modules/react  
2:55:16 PM: npm ERR! react@“^18.2.0” from the root project  
2:55:16 PM: npm ERR! peer react@“^18.0.0” from @testing-library/react@13.4.0  
2:55:16 PM: npm ERR! node\_modules/@testing-library/react  
2:55:16 PM: npm ERR! @testing-library/react@“^13.4.0” from the root project  
2:55:16 PM: npm ERR! 2 more (react-dom, react-scripts)  
2:55:16 PM: npm ERR!  
2:55:16 PM: npm ERR! Could not resolve dependency:  
2:55:16 PM: npm ERR! peer react@“^15.0.0 || ^16.0.0” from react-scroll-horizontal@1.6.6  
2:55:16 PM: npm ERR! node\_modules/react-scroll-horizontal  
2:55:16 PM: npm ERR! react-scroll-horizontal@“^1.6.6” from the root project  
2:55:16 PM: npm ERR!  
2:55:16 PM: npm ERR! Conflicting peer dependency: react@16.14.0  
2:55:16 PM: npm ERR! node\_modules/react  
2:55:16 PM: npm ERR! peer react@“^15.0.0 || ^16.0.0” from react-scroll-horizontal@1.6.6  
2:55:16 PM: npm ERR! node\_modules/react-scroll-horizontal  
2:55:16 PM: npm ERR! react-scroll-horizontal@“^1.6.6” from the root project  
2:55:16 PM: npm ERR!  
2:55:16 PM: npm ERR! Fix the upstream dependency conflict, or retry  
2:55:16 PM: npm ERR! this command with --force, or --legacy-peer-deps  
2:55:16 PM: npm ERR! to accept an incorrect (and potentially broken) dependency resolution.  
2:55:16 PM: npm ERR!  
2:55:16 PM: npm ERR! See /opt/buildhome/.npm/eresolve-report.txt for a full report.  
2:55:16 PM: npm ERR! A complete log of this run can be found in:  
2:55:16 PM: npm ERR! /opt/buildhome/.npm/\_logs/2022-12-16T09\_25\_15\_907Z-debug-0.log  
2:55:16 PM: Error during NPM install  
2:55:16 PM: Build was terminated: Build script returned non-zero exit code: 1  
2:55:17 PM: Failing build: Failed to build site  
2:55:17 PM: Finished processing build request in 8.371809579s

[Next page](https://answers.netlify.com/t/build-script-returned-non-zero-exit-code-1/8777.md?page=2)
