Error: Build script returned non-zero exit code: 1

Hi,
It seems the build is failing when I try to deploy my site to netlify.
I didn’t find any error in the logs apart from the last one concerning the build.

11:46:34 AM: Build ready to start
11:46:36 AM: build-image version: 2dbd444fcdce00cf06325060a8238d5ae3e86774
11:46:36 AM: build-image tag: v3.3.7
11:46:36 AM: buildbot version: 7f867b365e4c3934ca5b72b9d51f0a4d1f96685d
11:46:36 AM: Fetching cached dependencies
11:46:36 AM: Failed to fetch cache, continuing with build
11:46:36 AM: Starting to prepare the repo for build
11:46:36 AM: No cached dependencies found. Cloning fresh repo
11:46:36 AM: git clone https://github.com/HypariaMC/gameforest
11:46:39 AM: Preparing Git Reference refs/heads/master
11:46:40 AM: Starting build script
11:46:40 AM: Installing dependencies
11:46:41 AM: Downloading and installing node v10.20.0...
11:46:41 AM: Downloading https://nodejs.org/dist/v10.20.0/node-v10.20.0-linux-x64.tar.xz...
11:46:42 AM: 
########
11:46:42 AM:                                11.8%
11:46:42 AM: 
###########################################################
11:46:42 AM: ############# 100.0%
11:46:42 AM: Computing checksum with sha256sum
11:46:42 AM: Checksums matched!
11:46:44 AM: Now using node v10.20.0 (npm v6.14.4)
11:46:45 AM: Attempting ruby version 2.6.2, read from environment
11:46:46 AM: Using ruby version 2.6.2
11:46:46 AM: Using PHP version 5.6
11:46:46 AM: Started restoring cached node modules
11:46:46 AM: Finished restoring cached node modules
11:46:46 AM: Started restoring cached yarn cache
11:46:46 AM: Finished restoring cached yarn cache
11:46:46 AM: Installing yarn at version 1.17.0
11:46:46 AM: Installing Yarn!
11:46:46 AM: > Downloading tarball...
11:46:46 AM: [1/2]: https://yarnpkg.co
11:46:46 AM: m/downloads/1.17.0/yarn-v1.17.0.tar.gz -
11:46:46 AM: -> /tmp/yarn.t
11:46:46 AM: ar.gz.wU
11:46:46 AM: CS5WC1DV
11:46:46 AM:   % Total    % Re
11:46:46 AM: ceived % Xferd  Average Speed   Tim
11:46:46 AM: e    Time     Time  C
11:46:46 AM: urrent
11:46:46 AM:                                  Dload  Upload   Tot
11:46:46 AM: al   Spent    Left  Speed
11:46:46 AM: 
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
11:46:46 AM: 
100    80  100    80    0     0    265      0 --:--:-- --:--:-- -
11:46:46 AM: -:--:--   266
11:46:47 AM: 
100    93  100    93    0     0    164
11:46:47 AM:   0 --:--:-- --:--:-- --:--:--   164
11:46:47 AM: 
100   630  100   630    0     0
11:46:47 AM:     664      0 --:--:-- --:--:-- --:--:--   664
11:46:47 AM: 
  0     0    0     0
11:46:47 AM:     0     0      0      0 --:--:-- --:--:-- --:--:--     0
11:46:48 AM: 
100 1213k  100 1213k    0     0   860k      0  0:00:01  0:00:01 --:--:-- 2795k
11:46:48 AM: [2/2]: https://yarnpkg.com
11:46:48 AM: /downloads/1.17.0/yarn-v1.17.0.tar.gz.asc --> /tmp/yarn.ta
11:46:48 AM: r.gz.wUCS5WC1DV.asc
11:46:48 AM: 
100    84  100    84    0     0   30
11:46:48 AM: 10      0 --:--:-- --:--:-- --:--:--  3010
11:46:48 AM: 
100    97  100
11:46:48 AM:  97    0     0   1748      0 --:--:-- --:--:-- --:--:--  1748
11:46:48 AM: 1
11:46:48 AM: 0
11:46:48 AM: 0
11:46:48 AM:   634  100   634    0
11:46:48 AM:     0   2326      0 --:--:-- --:--
11:46:48 AM: :-- --:--:--  2326
11:46:48 AM: 
100   832  100   832    0
11:46:48 AM: 0   2651      0 --:--:-- --:--:-- --:--:--  2651
11:46:48 AM: > Verifying integrity...
11:46:48 AM: gpg: Signature made Fri 14 Jun 2019 06:55:58 PM UTC using RSA key ID 69475BAA
11:46:48 AM: gpg: Good signature from "Yarn Packaging <yarn@dan.cx>"
11:46:48 AM: gpg: WARNING: This key is not certified with a trusted signature!
11:46:48 AM: gpg:          There is no indication that the signature belongs to the owner.
11:46:48 AM: Primary key fingerprint: 72EC F46A 56B4 AD39 C907  BBB7 1646 B01B 86E5 0310
11:46:48 AM:      Subkey fingerprint: 6D98 490C 6F1A CDDD 448E  4595 4F77 6793 6947 5BAA
11:46:48 AM: > GPG signature looks good
11:46:48 AM: > Extracting to ~/.yarn...
11:46:48 AM: > Adding to $PATH...
11:46:49 AM: > Successfully installed Yarn 1.17.0! Please open another terminal where the `yarn` command will now be available.
11:46:49 AM: Installing NPM modules using Yarn version 1.17.0
11:46:50 AM: yarn install v1.17.0
11:46:50 AM: [1/4] Resolving packages...
11:46:50 AM: [2/4] Fetching packages...
11:47:09 AM: info fsevents@1.2.8: The platform "linux" is incompatible with this module.
11:47:09 AM: info "fsevents@1.2.8" is an optional dependency and failed compatibility check. Excluding it from installation.
11:47:09 AM: [3/4] Linking dependencies...
11:47:09 AM: warning " > babel-eslint@10.0.1" has unmet peer dependency "eslint@>= 4.12.1".
11:47:09 AM: warning " > eslint-config-xo@0.26.0" has unmet peer dependency "eslint@>=5.11.1".
11:47:09 AM: warning " > eslint-plugin-compat@3.1.1" has unmet peer dependency "eslint@^3.0.0 || ^4.0.0 || ^5.0.0".
11:47:09 AM: warning " > eslint-plugin-import@2.17.2" has unmet peer dependency "eslint@2.x - 5.x".
11:47:09 AM: warning " > eslint-plugin-unicorn@8.0.2" has unmet peer dependency "eslint@>=5.0.0".
11:47:09 AM: warning " > gulp-stylelint@9.0.0" has incorrect peer dependency "stylelint@^10.0.0".
11:47:09 AM: warning " > rollup-plugin-babel@4.3.2" has unmet peer dependency "rollup@>=0.60.0 <2".
11:47:18 AM: [4/4] Building fresh packages...
11:47:47 AM: Done in 57.38s.
11:47:47 AM: NPM modules installed using Yarn
11:47:47 AM: Started restoring cached go cache
11:47:47 AM: Finished restoring cached go cache
11:47:47 AM: unset GOOS;
11:47:47 AM: unset GOARCH;
11:47:47 AM: export GOROOT='/opt/buildhome/.gimme/versions/go1.12.linux.amd64';
11:47:47 AM: export PATH="/opt/buildhome/.gimme/versions/go1.12.linux.amd64/bin:${PATH}";
11:47:47 AM: go version >&2;
11:47:47 AM: export GIMME_ENV='/opt/buildhome/.gimme/env/go1.12.linux.amd64.env';
11:47:47 AM: go version go1.12 linux/amd64
11:47:47 AM: Installing missing commands
11:47:47 AM: Verify run directory
11:47:47 AM: Executing user command: gulp build
11:47:49 AM: [09:47:49]
11:47:49 AM: Using gulpfile /opt/build/repo/gulpfile.js
11:47:49 AM: [09:47:49]
11:47:49 AM: Task never defined: build
11:47:49 AM: [09:47:49]
11:47:49 AM: To list available tasks, try running: gulp --tasks
11:47:49 AM: Skipping functions preparation step: no functions directory set
11:47:49 AM: Caching artifacts
11:47:49 AM: Started saving node modules
11:47:49 AM: Finished saving node modules
11:47:49 AM: Started saving yarn cache
11:47:49 AM: Finished saving yarn cache
11:47:49 AM: Started saving pip cache
11:47:49 AM: Finished saving pip cache
11:47:49 AM: Started saving emacs cask dependencies
11:47:49 AM: Finished saving emacs cask dependencies
11:47:49 AM: Started saving maven dependencies
11:47:49 AM: Finished saving maven dependencies
11:47:49 AM: Started saving boot dependencies
11:47:49 AM: Finished saving boot dependencies
11:47:49 AM: Started saving go dependencies
11:47:49 AM: Finished saving go dependencies
11:47:54 AM: Error running command: Build script returned non-zero exit code: 1
11:47:54 AM: Failing build: Failed to build site
11:47:54 AM: failed during stage 'building site': Build script returned non-zero exit code: 1
11:47:54 AM: Finished processing build request in 1m18.88202468s

My deploy setting on Netlify are:

Base directory: Not set
Build command: gulp build
Publish directory: dist

Thanks for your help!

hi there,

your problem is definitely this:

11:47:47 AM: Executing user command: gulp build
11:47:49 AM: [09:47:49]
11:47:49 AM: Using gulpfile /opt/build/repo/gulpfile.js
11:47:49 AM: [09:47:49]
11:47:49 AM: Task never defined: build
11:47:49 AM: [09:47:49]
11:47:49 AM: To list available tasks, try running: gulp --tasks

something, likely the commands listed out in your package.json, isn’t set up correctly.

here you are saying: “hey gulp, run the build command” but I am going to guess that the build command isn’t defined in your package.json.

This Common Issue contains a ton of useful debugging tips for things like this.

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