Build script returned non-zero exit code: 1

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.

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:

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

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:

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"

Hi Perry,

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

{
  "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"
  }
}

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

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:

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.

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:
https://docs.netlify.com/configure-builds/troubleshooting-tips/#build-cache
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 :slight_smile:

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:

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

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 :frowning:

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.

1 Like

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

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

3 Likes