Build script returned non-zero exit code: 2

Netlify site name: noona.is

I’m facing a build error: Error running command: Build script returned non-zero exit code: 2
Local build works and it works as well via the Netlify Docker image: GitHub - netlify/build-image: This is the build image used for running automated builds

I found a similar issue but there doesn’t seem to be a sufficient solution here: Failed during stage 'building site': Build script returned non-zero exit code: 2 - #2 by fool

Is there a way to get more detailed error of what’s happening?

Build log
12:49:53 PM: Build ready to start
12:49:54 PM: build-image version: b0258b965567defc4a2d7e2f2dec2e00c8f73ad6
12:49:54 PM: build-image tag: v3.4.1
12:49:54 PM: buildbot version: c14f8ac04f7535496782ceb786d06f5741c8ed0f
12:49:55 PM: Fetching cached dependencies
12:49:55 PM: Failed to fetch cache, continuing with build
12:49:55 PM: Starting to prepare the repo for build
12:49:55 PM: No cached dependencies found. Cloning fresh repo
12:49:55 PM: git clone noona-hq/timatorg-web
12:49:56 PM: Preparing Git Reference refs/heads/qa
12:49:58 PM: Different publish path detected, going to use the one specified in the Netlify configuration file: ‘build’ versus ‘build/’ in the Netlify UI
12:49:58 PM: Starting build script
12:49:58 PM: Installing dependencies
12:49:58 PM: Python version set to 2.7
12:49:59 PM: Downloading and installing node v10.22.1…
12:49:59 PM: Downloading nodejs/dist/v10.22.1/node-v10.22.1-linux-x64.tar.xz…
12:49:59 PM: Computing checksum with sha256sum
12:49:59 PM: Checksums matched!
12:50:02 PM: Now using node v10.22.1 (npm v6.14.6)
12:50:02 PM: Started restoring cached build plugins
12:50:02 PM: Finished restoring cached build plugins
12:50:02 PM: Attempting ruby version 2.6.2, read from environment
12:50:03 PM: Using ruby version 2.6.2
12:50:04 PM: Using PHP version 5.6
12:50:04 PM: 5.2 is already installed.
12:50:04 PM: Using Swift version 5.2
12:50:04 PM: Started restoring cached node modules
12:50:04 PM: Finished restoring cached node modules
12:50:04 PM: Started restoring cached yarn cache
12:50:04 PM: Finished restoring cached yarn cache
12:50:04 PM: Installing yarn at version 1.13.0
12:50:04 PM: Installing Yarn!
12:50:04 PM: > Downloading tarball…
12:50:04 PM: [1/2]: yarn/downloads/1.13.0/yarn-v1.13.0.tar.gz → /tmp/yarn.tar.gz.MIF9JgKHvN
12:50:04 PM: % Total % Received % Xferd Average Speed Time Time Time Current
12:50:04 PM: Dload Upload Total Spent Left Speed
12:50:04 PM: 0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0
12:50:04 PM: 100 80 100 80 0 0 243 0 --:–:-- --:–:-- --:–:-- 243
12:50:04 PM: 0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0
12:50:04 PM: 100 93 100 93 0 0 133 0 --:–:-- --:–:-- --:–:-- 300
12:50:05 PM: 100 643 100 643 0 0 593 0 0:00:01 0:00:01 --:–:-- 593
12:50:05 PM: 3 1142k 3 43970 0 0 31617 0 0:00:36 0:00:01 0:00:35 31617
12:50:05 PM: 100 1142k 100 1142k 0 0 756k 0 0:00:01 0:00:01 --:–:-- 9315k
12:50:05 PM: [2/2]: yarnpkg/downloads/1.13.0/yarn-v1.13.0.tar.gz.asc → /tmp/yarn.tar.gz.MIF9JgKHvN.asc
12:50:05 PM: 100 84 100 84 0 0 3123 0 --:–:-- --:–:-- --:–:-- 3123
12:50:05 PM: 100 97 100 97 0 0 1781 0 --:–:-- --:–:-- --:–:-- 1781
12:50:05 PM: 100 647 100 647 0 0 3478 0 --:–:-- --:–:-- --:–:-- 3478
12:50:05 PM: 100 832 100 832 0 0 3663 0 --:–:-- --:–:-- --:–:-- 3663
12:50:05 PM: > Verifying integrity…
12:50:06 PM: gpg: Signature made Tue 18 Dec 2018 04:04:55 PM UTC using RSA key ID B6FF4DE3
12:50:06 PM: gpg: Good signature from “Yarn Packaging yarn@dan.cx
12:50:06 PM: gpg: Note: This key has expired!
12:50:06 PM: Primary key fingerprint: 72EC F46A 56B4 AD39 C907 BBB7 1646 B01B 86E5 0310
12:50:06 PM: Subkey fingerprint: E219 30C4 D0A4 AA46 1858 1F7A E074 D16E B6FF 4DE3
12:50:06 PM: > GPG signature looks good
12:50:06 PM: > Extracting to ~/.yarn…
12:50:06 PM: > Adding to $PATH…
12:50:06 PM: > Successfully installed Yarn 1.13.0! Please open another terminal where the yarn command will now be available.
12:50:07 PM: Installing NPM modules using Yarn version 1.13.0
12:50:07 PM: yarn install v1.13.0
12:50:07 PM: [1/4] Resolving packages…
12:50:08 PM: [2/4] Fetching packages…
12:50:34 PM: info fsevents@2.1.2: The platform “linux” is incompatible with this module.
12:50:34 PM: info “fsevents@2.1.2” is an optional dependency and failed compatibility check. Excluding it from installation.
12:50:34 PM: info fsevents@1.2.13: The platform “linux” is incompatible with this module.
12:50:34 PM: info “fsevents@1.2.13” is an optional dependency and failed compatibility check. Excluding it from installation.
12:50:34 PM: info fsevents@2.1.3: The platform “linux” is incompatible with this module.
12:50:34 PM: info “fsevents@2.1.3” is an optional dependency and failed compatibility check. Excluding it from installation.
12:50:34 PM: [3/4] Linking dependencies…
12:50:34 PM: warning " > react-apollo@2.5.8" has unmet peer dependency “apollo-client@^2.6.3”.
12:50:34 PM: warning " > react-dates@21.8.0" has unmet peer dependency “@babel/runtime@^7.0.0”.
12:50:34 PM: warning " > react-dates@21.8.0" has unmet peer dependency “react-with-direction@^1.3.1”.
12:50:34 PM: warning “react-dates > react-with-styles@4.1.0” has unmet peer dependency “@babel/runtime@^7.0.0”.
12:50:34 PM: warning “react-dates > react-with-styles-interface-css@6.0.0” has unmet peer dependency “@babel/runtime@^7.0.0”.
12:50:34 PM: warning " > react-ga@2.7.0" has unmet peer dependency “prop-types@^15.6.0”.
12:50:46 PM: [4/4] Building fresh packages…
12:50:47 PM: Done in 39.93s.
12:50:47 PM: NPM modules installed using Yarn
12:50:47 PM: Started restoring cached go cache
12:50:47 PM: Finished restoring cached go cache
12:50:47 PM: Installing Go version 1.12
12:50:53 PM: unset GOOS;
12:50:53 PM: unset GOARCH;
12:50:53 PM: export GOROOT=’/opt/buildhome/.gimme_cache/versions/go1.12.linux.amd64’;
12:50:53 PM: export PATH="/opt/buildhome/.gimme_cache/versions/go1.12.linux.amd64/bin:${PATH}";
12:50:53 PM: go version >&2;
12:50:53 PM: export GIMME_ENV="/opt/buildhome/.gimme_cache/env/go1.12.linux.amd64.env"
12:50:53 PM: go version go1.12 linux/amd64
12:50:53 PM: Installing missing commands
12:50:53 PM: Verify run directory
12:50:54 PM: ​
12:50:54 PM: ┌─────────────────────────────┐
12:50:54 PM: │ Netlify Build │
12:50:54 PM: └─────────────────────────────┘
12:50:54 PM: ​
12:50:54 PM: ❯ Version
12:50:54 PM: @netlify/build 4.4.0
12:50:54 PM: ​
12:50:54 PM: ❯ Flags
12:50:54 PM: deployId: 5f747ef1462a7300078fe606
12:50:54 PM: mode: buildbot
12:50:54 PM: ​
12:50:54 PM: ❯ Current directory
12:50:54 PM: /opt/build/repo
12:50:54 PM: ​
12:50:54 PM: ❯ Config file
12:50:54 PM: /opt/build/repo/netlify.toml
12:50:54 PM: ​
12:50:54 PM: ❯ Context
12:50:54 PM: branch-deploy
12:50:54 PM: ​
12:50:54 PM: ┌────────────────────────────────────┐
12:50:54 PM: │ 1. build.command from netlify.toml │
12:50:54 PM: └────────────────────────────────────┘
12:50:54 PM: ​
12:50:54 PM: $ yarn build
12:50:54 PM: yarn run v1.13.0
12:50:55 PM: $ react-scripts build && cp _redirects build/
12:50:56 PM: Creating an optimized production build…
12:52:34 PM:
12:52:34 PM: Treating warnings as errors because process.env.CI = true.
12:52:34 PM: Most CI servers set it automatically.
12:52:34 PM:
12:52:34 PM: Failed to compile.
12:52:34 PM:
12:52:34 PM: ./src/scenes/landing/MapContainer.js
12:52:34 PM: Line 186:3: Number prototype is read only, properties should not be added no-extend-native
12:52:34 PM: Line 193:3: Number prototype is read only, properties should not be added no-extend-native
12:52:34 PM: ./src/timatorg-utils/StringUtils.js
12:52:34 PM: Line 42:22: Unnecessary escape character: [ no-useless-escape
12:52:34 PM: Line 42:47: Unnecessary escape character: [ no-useless-escape
12:52:34 PM: ./src/serviceWorker.js
12:52:34 PM: Line 42:80: Unexpected string concatenation of literals no-useless-concat
12:52:34 PM: Line 67:81: Unexpected string concatenation of literals no-useless-concat
12:52:34 PM: ./src/Navigator.js
12:52:34 PM: Line 51:9: The ‘fetchUser’ function makes the dependencies of useEffect Hook (at line 69) change on every render. To fix this, wrap the ‘fetchUser’ definition into its own useCallback() Hook react-hooks/exhaustive-deps
12:52:34 PM: Line 51:9: The ‘fetchUser’ function makes the dependencies of useEffect Hook (at line 93) change on every render. To fix this, wrap the ‘fetchUser’ definition into its own useCallback() Hook react-hooks/exhaustive-deps
12:52:34 PM: error Command failed with exit code 1.
12:52:34 PM: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
12:52:34 PM: ​
12:52:34 PM: ┌─────────────────────────────┐
12:52:34 PM: │ “build.command” failed │
12:52:34 PM: └─────────────────────────────┘
12:52:34 PM: ​
12:52:34 PM: Error message
12:52:34 PM: Command failed with exit code 1: yarn build
12:52:34 PM: ​
12:52:34 PM: Error location
12:52:34 PM: In build.command from netlify.toml:
12:52:34 PM: yarn build
12:52:34 PM: ​
12:52:34 PM: Resolved config
12:52:34 PM: build:
12:52:34 PM: command: yarn build
12:52:34 PM: commandOrigin: config
12:52:34 PM: environment:
12:52:34 PM: - API_URL
12:52:34 PM: - NODE_ENV
12:52:34 PM: - NPM_TOKEN
12:52:34 PM: - REACT_APP_BUGSNAG_KEY
12:52:34 PM: - REACT_APP_GRAPHQL_ENDPOINT
12:52:34 PM: - REACT_APP_MAPBOX_TOKEN
12:52:34 PM: - REACT_APP_SENTRY_KEY
12:52:34 PM: publish: /opt/build/repo/build
12:52:34 PM: headers:
12:52:34 PM: - for: /* values: Cache-Control: ‘public, max-age=0, must-revalidate’ redirects: - from: /* status: 200 to: /index.htmlCaching artifacts
12:52:34 PM: Started saving node modules
12:52:34 PM: Finished saving node modules
12:52:34 PM: Started saving build plugins
12:52:34 PM: Finished saving build plugins
12:52:34 PM: Started saving yarn cache
12:52:34 PM: Finished saving yarn cache
12:52:34 PM: Started saving pip cache
12:52:34 PM: Finished saving pip cache
12:52:34 PM: Started saving emacs cask dependencies
12:52:34 PM: Finished saving emacs cask dependencies
12:52:34 PM: Started saving maven dependencies
12:52:34 PM: Finished saving maven dependencies
12:52:34 PM: Started saving boot dependencies
12:52:34 PM: Finished saving boot dependencies
12:52:34 PM: Started saving go dependencies
12:52:36 PM: Finished saving go dependencies
12:52:39 PM: Error running command: Build script returned non-zero exit code: 2
12:52:39 PM: Failing build: Failed to build site
12:52:39 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2
12:52:39 PM: Finished processing build request in 2m44.864718139s

I tried limiting the memory in docker run by modifying the start-image.sh script as seen below. It still succeeds building locally.

#!/bin/bash

BASE_PATH=$(pwd)
REPO_PATH=$(cd $1 && pwd)
: ${NETLIFY_IMAGE="netlify/build:xenial"}

docker run --rm -t -i \
        -m 3g \
        -e NODE_VERSION \
        -e NPM_VERSION \
        -e RUBY_VERSION \
        -e YARN_VERSION \
        -e HUGO_VERSION \
        -e PHP_VERSION \
        -e GO_VERSION \
        -e SWIFT_VERSION \
        -e PYTHON_VERSION \
        -v ${REPO_PATH}:/opt/repo \
        -v ${BASE_PATH}/run-build.sh:/opt/build-bin/build \
        -v ${BASE_PATH}/run-build-functions.sh:/opt/build-bin/run-build-functions.sh \
        $NETLIFY_IMAGE /bin/bash
12:50:56 PM: Creating an optimized production build…
12:52:34 PM:
12:52:34 PM: Treating warnings as errors because process.env.CI = true.
12:52:34 PM: Most CI servers set it automatically.

hi there, this might be a useful read:

1 Like

Thanks. It works to set the CI environment variable to false/undefined.

In your opinion, would this be classified as a bug from create-react-app? Should it be able to handle the CI environment variable to be truthy?

The answer is “it depends” - some people expect that to work differently than others. Too bad it is a “de-facto” standard rather than one that is documented and universally agreed upon.

From their point of view, they are doing what they intend. From others’ points of view, such as ours, they are doing it differently than the people who created the convention perhaps intended…

I suspect if you file a bug on their project, they’ll tell you the same thing, but I’m not sure :slight_smile:

Interesting. Is this a requirement for all React apps that are created with create-react-app? To specify CI= prior to their build?

1 Like

Nope! Only ones that don’t run without warnings, which you want to run in a CI system like Travis or Netlify :slight_smile:

Ah, got it. Thanks :grinning:

I found this post to be a good read if anyone’s interested in diving deeper: How to fix build failures with `create-react-app` in production

1 Like

Hi,
I am new here and learning. When I tried to add the new field to the existing Setup, The build was failed and error returned is [Build script returned non-zero exit code: 2].

appreciate for the quick Help

screenshots



just followed the previous code add the field

hi there, can you please paste your full build log with the exact error? thanks!

7:29:40 PM: Build ready to start
7:29:42 PM: build-image version: 53b83b6bede2920f236b25b6f5a95334320dc849
7:29:42 PM: build-image tag: v3.6.0
7:29:42 PM: buildbot version: a706ec7a557bcc28584843816a376a10c08955ca
7:29:42 PM: Fetching cached dependencies
7:29:42 PM: Failed to fetch cache, continuing with build
7:29:42 PM: Starting to prepare the repo for build
7:29:42 PM: No cached dependencies found. Cloning fresh repo
7:29:42 PM: git clone https://github.com/Rakeshpradhan1999/Image_gallary
7:29:44 PM: Preparing Git Reference refs/heads/main
7:29:45 PM: Different publish path detected, going to use the one specified in the Netlify configuration file: ‘build’ versus ‘build/’ in the Netlify UI
7:29:46 PM: Starting build script
7:29:46 PM: Installing dependencies
7:29:46 PM: Python version set to 2.7
7:29:47 PM: v12.18.0 is already installed.
7:29:48 PM: Now using node v12.18.0 (npm v6.14.4)
7:29:48 PM: Started restoring cached build plugins
7:29:48 PM: Finished restoring cached build plugins
7:29:48 PM: Attempting ruby version 2.7.1, read from environment
7:29:49 PM: Using ruby version 2.7.1
7:29:50 PM: Using PHP version 5.6
7:29:50 PM: Started restoring cached node modules
7:29:50 PM: Finished restoring cached node modules
7:29:50 PM: Installing NPM modules using NPM version 6.14.4
7:30:25 PM: > core-js@2.6.12 postinstall /opt/build/repo/node_modules/babel-runtime/node_modules/core-js
7:30:25 PM: > node -e “try{require(’./postinstall’)}catch(e){}”
7:30:26 PM: > core-js@3.8.2 postinstall /opt/build/repo/node_modules/core-js
7:30:26 PM: > node -e “try{require(’./postinstall’)}catch(e){}”
7:30:26 PM: > core-js-pure@3.8.2 postinstall /opt/build/repo/node_modules/core-js-pure
7:30:26 PM: > node -e “try{require(’./postinstall’)}catch(e){}”
7:30:26 PM: > ejs@2.7.4 postinstall /opt/build/repo/node_modules/ejs
7:30:26 PM: > node ./postinstall.js
7:30:29 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/webpack-dev-server/node_modules/fsevents):
7:30:29 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
7:30:29 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/watchpack-chokidar2/node_modules/fsevents):
7:30:29 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
7:30:29 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.1 (node_modules/fsevents):
7:30:29 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.1: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
7:30:29 PM: added 1949 packages from 771 contributors and audited 1952 packages in 38.235s
7:30:31 PM: 128 packages are looking for funding
7:30:31 PM: run npm fund for details
7:30:31 PM: found 0 vulnerabilities
7:30:31 PM: NPM modules installed
7:30:31 PM: Started restoring cached go cache
7:30:31 PM: Finished restoring cached go cache
7:30:31 PM: go version go1.14.4 linux/amd64
7:30:31 PM: go version go1.14.4 linux/amd64
7:30:31 PM: Installing missing commands
7:30:31 PM: Verify run directory
7:30:33 PM: ​
7:30:33 PM: ────────────────────────────────────────────────────────────────
7:30:33 PM: Netlify Build
7:30:33 PM: ────────────────────────────────────────────────────────────────
7:30:33 PM: ​
7:30:33 PM: ❯ Version
7:30:33 PM: @netlify/build 8.0.3
7:30:33 PM: ​
7:30:33 PM: ❯ Flags
7:30:33 PM: deployId: 60004e4c691bc90cb586943b
7:30:33 PM: mode: buildbot
7:30:33 PM: ​
7:30:33 PM: ❯ Current directory
7:30:33 PM: /opt/build/repo
7:30:33 PM: ​
7:30:33 PM: ❯ Config file
7:30:33 PM: No config file was defined: using default values.
7:30:33 PM: ​
7:30:33 PM: ❯ Context
7:30:33 PM: production
7:30:33 PM: ​
7:30:33 PM: ────────────────────────────────────────────────────────────────
7:30:33 PM: 1. Build command from Netlify app
7:30:33 PM: ────────────────────────────────────────────────────────────────
7:30:33 PM: ​
7:30:33 PM: $ npm run build
7:30:34 PM: > image-gallary@0.1.0 build /opt/build/repo
7:30:34 PM: > react-scripts build
7:30:36 PM: Creating an optimized production build…
7:30:59 PM:
7:30:59 PM: Treating warnings as errors because process.env.CI = true.
7:30:59 PM: Most CI servers set it automatically.
7:30:59 PM:
7:30:59 PM: Failed to compile.
7:30:59 PM:
7:30:59 PM: src/App.js
7:30:59 PM: Line 30:5: React Hook useEffect has a missing dependency: ‘fetchData’. Either include it or remove the dependency array react-hooks/exhaustive-deps
7:30:59 PM: npm ERR! code ELIFECYCLE
7:30:59 PM: npm ERR! errno 1
7:30:59 PM: npm ERR! image-gallary@0.1.0 build: react-scripts build
7:30:59 PM: npm ERR! Exit status 1
7:30:59 PM: npm ERR!
7:30:59 PM: npm ERR! Failed at the image-gallary@0.1.0 build script.
7:30:59 PM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
7:30:59 PM: npm ERR! A complete log of this run can be found in:
7:30:59 PM: npm ERR! /opt/buildhome/.npm/_logs/2021-01-14T14_00_59_811Z-debug.log
7:30:59 PM: ​
7:30:59 PM: ────────────────────────────────────────────────────────────────
7:30:59 PM: “build.command” failed
7:30:59 PM: ────────────────────────────────────────────────────────────────
7:30:59 PM: ​
7:30:59 PM: Error message
7:30:59 PM: Command failed with exit code 1: npm run build
7:30:59 PM: ​
7:30:59 PM: Error location
7:30:59 PM: In Build command from Netlify app:
7:30:59 PM: npm run build
7:30:59 PM: ​
7:30:59 PM: Resolved config
7:30:59 PM: build:
7:30:59 PM: command: npm run build
7:30:59 PM: commandOrigin: ui
7:30:59 PM: publish: /opt/build/repo/build
7:30:59 PM: Caching artifacts
7:30:59 PM: Started saving node modules
7:30:59 PM: Finished saving node modules
7:30:59 PM: Started saving build plugins
7:30:59 PM: Finished saving build plugins
7:30:59 PM: Started saving pip cache
7:31:00 PM: Finished saving pip cache
7:31:00 PM: Started saving emacs cask dependencies
7:31:00 PM: Finished saving emacs cask dependencies
7:31:00 PM: Started saving maven dependencies
7:31:00 PM: Finished saving maven dependencies
7:31:00 PM: Started saving boot dependencies
7:31:00 PM: Finished saving boot dependencies
7:31:00 PM: Started saving rust rustup cache
7:31:00 PM: Finished saving rust rustup cache
7:31:00 PM: Started saving rust cargo bin cache
7:31:00 PM: Finished saving rust cargo bin cache
7:31:00 PM: Started saving go dependencies
7:31:00 PM: Finished saving go dependencies
7:31:02 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
7:31:02 PM: Failing build: Failed to build site
7:31:02 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2
7:31:02 PM: Finished processing build request in 1m20.707600678s

plz help me

Hiya, sorry you are having trouble with your build.

This Support Guide contains a ton of useful debugging tips that can likely help you solve your problem :slight_smile:

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

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

I am coming across the same error when trying to deploy a Next JS project. Has anyone recently come across this and managed to fix the issue?

Relatively new to development and am really struggling to find a solution. Thanks :slight_smile:

1 Like

I am facing the same issue and I already tried everything in this forum to fix this issue.
Please, can someone help me?

I tried change the build command to:
CI= yarn build
CI= npm run build
yarn build
npm run build

My last push was just a regular one with code changes, nothing changed in the structure or configuration of my web app. What else can I try?

Thank you very much!

2:11:59 PM: Build ready to start
2:12:01 PM: build-image version: d84c79427e8f83c1ba17bcdd7b3fe38059376b68
2:12:01 PM: build-image tag: v3.6.1
2:12:01 PM: buildbot version: 6e6aea7d76311a0c42653f0d9401a243be70e13d
2:12:01 PM: Building without cache
2:12:01 PM: Starting to prepare the repo for build
2:12:02 PM: No cached dependencies found. Cloning fresh repo
2:12:02 PM: git clone https://github.com/ldgmaia/RBFront
2:12:03 PM: Preparing Git Reference refs/heads/master
2:12:04 PM: Different publish path detected, going to use the one specified in the Netlify configuration file: ‘build’ versus ‘build/’ in the Netlify UI
2:12:04 PM: Starting build script
2:12:05 PM: Installing dependencies
2:12:05 PM: Python version set to 2.7
2:12:06 PM: Downloading and installing node v10.23.2…
2:12:06 PM: Downloading https://nodejs.org/dist/v10.23.2/node-v10.23.2-linux-x64.tar.xz
2:12:06 PM: Computing checksum with sha256sum
2:12:06 PM: Checksums matched!
2:12:09 PM: Now using node v10.23.2 (npm v6.14.10)
2:12:09 PM: Started restoring cached build plugins
2:12:09 PM: Finished restoring cached build plugins
2:12:09 PM: Attempting ruby version 2.6.2, read from environment
2:12:10 PM: Using ruby version 2.6.2
2:12:10 PM: Using PHP version 5.6
2:12:10 PM: Started restoring cached node modules
2:12:10 PM: Finished restoring cached node modules
2:12:10 PM: Started restoring cached yarn cache
2:12:10 PM: Finished restoring cached yarn cache
2:12:10 PM: Installing yarn at version 1.17.0
2:12:10 PM: Installing Yarn!
2:12:10 PM: > Downloading tarball…
2:12:10 PM: [1/2]: https://yarnpkg.com/downloads/1.17.0/yarn-v1.17.0.tar.gz → /tmp/yarn.tar.gz.2ymDNJxzg7
2:12:10 PM: % Total % Received % Xferd Average Speed Time Time Time Current
2:12:10 PM: Dload Upload Total Spent Left Speed
2:12:10 PM: 0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0
2:12:11 PM: 0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0
2:12:11 PM: 100 80 100 80 0 0 268 0 --:–:-- --:–:-- --:–:-- 267
2:12:11 PM: 100 93 100 93 0 0 123 0 --:–:-- --:–:-- --:–:-- 123
2:12:11 PM: 100 625 100 625 0 0 618 0 0:00:01 0:00:01 --:–:-- 618
2:12:12 PM: 0 0 0 0 0 0 0 0 --:–:-- 0:00:01 --:–:-- 0
2:12:12 PM: 100 1213k 100 1213k 0 0 888k 0 0:00:01 0:00:01 --:–:-- 4494k
2:12:12 PM: [2/2]: https://yarnpkg.com/downloads/1.17.0/yarn-v1.17.0.tar.gz.asc → /tmp/yarn.tar.gz.2ymDNJxzg7.asc
2:12:12 PM: 100 84 100 84 0 0 1118 0 --:–:-- --:–:-- --:–:-- 1118
2:12:12 PM: 100 97 100 97 0 0 768 0 --:–:-- --:–:-- --:–:-- 768
2:12:12 PM: 100 629 100 629 0 0 4017 0 --:–:-- --:–:-- --:–:-- 4017
2:12:12 PM: 100 832 100 832 0 0 4937 0 --:–:-- --:–:-- --:–:-- 4937
2:12:12 PM: > Verifying integrity…
2:12:12 PM: gpg: Signature made Fri 14 Jun 2019 06:55:58 PM UTC using RSA key ID 69475BAA
2:12:12 PM: gpg: Good signature from “Yarn Packaging yarn@dan.cx
2:12:12 PM: gpg: Note: This key has expired!
2:12:12 PM: Primary key fingerprint: 72EC F46A 56B4 AD39 C907 BBB7 1646 B01B 86E5 0310
2:12:12 PM: Subkey fingerprint: 6D98 490C 6F1A CDDD 448E 4595 4F77 6793 6947 5BAA
2:12:12 PM: > GPG signature looks good
2:12:12 PM: > Extracting to ~/.yarn…
2:12:12 PM: > Adding to PATH... 2:12:13 PM: > Successfully installed Yarn 1.17.0! Please open another terminal where the `yarn` command will now be available. 2:12:13 PM: Installing NPM modules using Yarn version 1.17.0 2:12:13 PM: yarn install v1.17.0 2:12:14 PM: [1/4] Resolving packages... 2:12:14 PM: [2/4] Fetching packages... 2:13:00 PM: info fsevents@2.1.3: The platform "linux" is incompatible with this module. 2:13:00 PM: info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation. 2:13:00 PM: info fsevents@1.2.13: The platform "linux" is incompatible with this module. 2:13:00 PM: info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation. 2:13:00 PM: info fsevents@2.0.7: The platform "linux" is incompatible with this module. 2:13:00 PM: info "fsevents@2.0.7" is an optional dependency and failed compatibility check. Excluding it from installation. 2:13:00 PM: [3/4] Linking dependencies... 2:13:00 PM: warning " > @material-ui/pickers@3.2.10" has unmet peer dependency "@date-io/core@^1.3.6". 2:13:00 PM: warning " > material-table@1.69.0" has unmet peer dependency "@date-io/core@^1.3.6". 2:13:00 PM: warning " > mui-datatables@2.15.0" has incorrect peer dependency "@material-ui/core@^3.2.0". 2:13:00 PM: warning " > mui-datatables@2.15.0" has incorrect peer dependency "@material-ui/icons@^3.0.1". 2:13:00 PM: 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". 2:13:00 PM: warning " > @babel/plugin-proposal-class-properties@7.10.4" has unmet peer dependency "@babel/core@^7.0.0-0". 2:13:00 PM: warning " > reactotron-redux@3.1.3" has unmet peer dependency "reactotron-core-client@^2.5.0". 2:13:00 PM: warning " > reactotron-redux-saga@4.2.3" has unmet peer dependency "@redux-saga/is@^1.0.1". 2:13:00 PM: warning " > reactotron-redux-saga@4.2.3" has unmet peer dependency "reactotron-core-client@^2.5.0". 2:13:00 PM: warning " > tablex@1.17.4" has incorrect peer dependency "antd@^3.20.3". 2:13:00 PM: warning " > eslint-import-resolver-babel-plugin-root-import@1.1.1" has incorrect peer dependency "babel-plugin-root-import@^5.1.0". 2:13:32 PM: [4/4] Building fresh packages... 2:13:33 PM: Done in 80.02s. 2:13:34 PM: NPM modules installed using Yarn 2:13:34 PM: Started restoring cached go cache 2:13:34 PM: Finished restoring cached go cache 2:13:34 PM: Installing Go version 1.12 2:13:39 PM: unset GOOS; 2:13:39 PM: unset GOARCH; 2:13:39 PM: export GOROOT='/opt/buildhome/.gimme_cache/versions/go1.12.linux.amd64'; 2:13:39 PM: export PATH="/opt/buildhome/.gimme_cache/versions/go1.12.linux.amd64/bin:{PATH}";
2:13:39 PM: go version >&2;
2:13:39 PM: export GIMME_ENV="/opt/buildhome/.gimme_cache/env/go1.12.linux.amd64.env"
2:13:39 PM: go version go1.12 linux/amd64
2:13:39 PM: Installing missing commands
2:13:39 PM: Verify run directory
2:13:41 PM: ​
2:13:41 PM: ────────────────────────────────────────────────────────────────
2:13:41 PM: Netlify Build
2:13:41 PM: ────────────────────────────────────────────────────────────────
2:13:41 PM: ​
2:13:41 PM: ❯ Version
2:13:41 PM: @netlify/build 9.1.0
2:13:41 PM: ​
2:13:41 PM: ❯ Flags
2:13:41 PM: deployId: 6022de7fadadb30127e52db5
2:13:41 PM: mode: buildbot
2:13:41 PM: ​
2:13:41 PM: ❯ Current directory
2:13:41 PM: /opt/build/repo
2:13:41 PM: ​
2:13:41 PM: ❯ Config file
2:13:41 PM: No config file was defined: using default values.
2:13:41 PM: ​
2:13:41 PM: ❯ Context
2:13:41 PM: production
2:13:41 PM: ​
2:13:41 PM: ────────────────────────────────────────────────────────────────
2:13:41 PM: 1. Build command from Netlify app
2:13:41 PM: ────────────────────────────────────────────────────────────────
2:13:41 PM: ​
2:13:41 PM: $ CI= npm run build
2:13:42 PM: > web@0.1.0 build /opt/build/repo
2:13:42 PM: > react-app-rewired build
2:13:43 PM: Creating an optimized production build…
2:17:22 PM: <— Last few GCs —>
2:17:22 PM: [1634:0x4523f60] 216479 ms: Scavenge 1355.5 (1420.0) → 1355.0 (1420.5) MB, 4.0 / 0.0 ms (average mu = 0.186, current mu = 0.117) allocation failure
2:17:22 PM: [1634:0x4523f60] 216486 ms: Scavenge 1355.6 (1420.5) → 1355.2 (1421.0) MB, 5.1 / 0.0 ms (average mu = 0.186, current mu = 0.117) allocation failure
2:17:22 PM: [1634:0x4523f60] 218363 ms: Mark-sweep 1358.6 (1423.8) → 1355.5 (1417.3) MB, 1859.7 / 0.0 ms (average mu = 0.129, current mu = 0.069) allocation failure GC in old space requested
2:17:22 PM: <— JS stacktrace —>
2:17:22 PM: ==== JS stack trace =========================================
2:17:22 PM: 0: ExitFrame [pc: 0x208f57dbf1d]
2:17:22 PM: Security context: 0x2baa3829e6c1
2:17:22 PM: 1: /* anonymous / [0x3a10a43bfbb9] [/opt/build/repo/node_modules/source-map/lib/source-node.js:~174] [pc=0x208f76e089c](this=0x2c96e2e9e601 ,chunk=0x3b7d8d03e251 )
2:17:22 PM: 2: arguments adaptor frame: 3->1
2:17:22 PM: 3: SourceNode_add [0x109111cd4a81] [/opt/build/repo/node_modules/source-map/lib/source-…
2:17:22 PM: FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
2:17:22 PM: 1: 0x8fb090 node::Abort() [node]
2:17:22 PM: 2: 0x8fb0dc [node]
2:17:22 PM: 3: 0xb0336e v8::Utils::ReportOOMFailure(v8::internal::Isolate
, char const*, bool) [node]
2:17:22 PM: 4: 0xb035a4 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
2:17:22 PM: 5: 0xef7602 [node]
2:17:22 PM: 6: 0xef7708 v8::internal::Heap::CheckIneffectiveMarkCompact(unsigned long, double) [node]
2:17:22 PM: 7: 0xf037e2 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [node]
2:17:22 PM: 8: 0xf04114 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
2:17:22 PM: 9: 0xf06d81 v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [node]
2:17:22 PM: 10: 0xecfe76 v8::internal::factory::AllocateRawArray(int, v8::internal::PretenureFlag) [node]
2:17:22 PM: 11: 0xed06fa v8::internal::factory::NewFixedArrayWithFiller(v8::internal::Heap::RootListIndex, int, v8::internal::Object*, v8::internal::PretenureFlag) [node]
2:17:22 PM: 12: 0xed0cb7 v8::internal::factory::NewUninitializedFixedArray(int, v8::internal::PretenureFlag) [node]
2:17:22 PM: 13: 0xe8403f [node]
2:17:22 PM: 14: 0x112a6cd v8::internal::Runtime_GrowArrayElements(int, v8::internal::Object**, v8::internal::Isolate*) [node]
2:17:22 PM: 15: 0x208f57dbf1d
2:17:28 PM: npm ERR! code ELIFECYCLE
2:17:28 PM: npm ERR! errno 1
2:17:28 PM: npm ERR! web@0.1.0 build: react-app-rewired build
2:17:28 PM: npm ERR! Exit status 1
2:17:28 PM: npm ERR!
2:17:28 PM: npm ERR! Failed at the web@0.1.0 build script.
2:17:28 PM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2:17:28 PM: npm ERR! A complete log of this run can be found in:
2:17:28 PM: npm ERR! /opt/buildhome/.npm/_logs/2021-02-09T19_17_28_399Z-debug.log
2:17:28 PM: ​
2:17:28 PM: ────────────────────────────────────────────────────────────────
2:17:28 PM: “build.command” failed
2:17:28 PM: ────────────────────────────────────────────────────────────────
2:17:28 PM: ​
2:17:28 PM: Error message
2:17:28 PM: Command failed with exit code 1: CI= npm run build
2:17:28 PM: ​
2:17:28 PM: Error location
2:17:28 PM: In Build command from Netlify app:
2:17:28 PM: CI= npm run build
2:17:28 PM: ​
2:17:28 PM: Resolved config
2:17:28 PM: build:
2:17:28 PM: command: CI= npm run build
2:17:28 PM: commandOrigin: ui
2:17:28 PM: environment:
2:17:28 PM: - REACT_APP_API_URL
2:17:28 PM: publish: /opt/build/repo/build
2:17:28 PM: Caching artifacts
2:17:28 PM: Started saving node modules
2:17:28 PM: Finished saving node modules
2:17:28 PM: Started saving build plugins
2:17:28 PM: Finished saving build plugins
2:17:28 PM: Started saving yarn cache
2:17:28 PM: Finished saving yarn cache
2:17:28 PM: Started saving pip cache
2:17:28 PM: Finished saving pip cache
2:17:28 PM: Started saving emacs cask dependencies
2:17:28 PM: Finished saving emacs cask dependencies
2:17:28 PM: Started saving maven dependencies
2:17:28 PM: Finished saving maven dependencies
2:17:28 PM: Started saving boot dependencies
2:17:28 PM: Finished saving boot dependencies
2:17:28 PM: Started saving rust rustup cache
2:17:28 PM: Finished saving rust rustup cache
2:17:28 PM: Started saving go dependencies
2:17:30 PM: Finished saving go dependencies
2:17:33 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
2:17:33 PM: Failing build: Failed to build site
2:17:34 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2
2:17:34 PM: Finished processing build request in 5m32.870083178s

OK, I just fixed it!

I deleted yarn.lock and node_modules folder and then I executed yarn command again.
New yarn.lock was created.
I git pushed it to master and after that the building worked.

2 Likes

Yes im dealing with this issue aswell. I have a nextJs application and deploying a template purchased online

Going to have to try this