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

Having an issue with deploying after not pushing for a few months. I added --force and set the variables in the environment settings. Doesn’t do anything for me. I think I am having an issue where yarn is building the site here but it should be NPM instead? Not sure exactly. My successful builds did not use yarn as much as this log is indicating. I attached the log for the build below. Thank you

1:55:12 AM: Build ready to start
1:55:14 AM: build-image version: 6ac9cdbcc295289dbaea7d39b2f1a3ac25ad3380 (xenial)
1:55:14 AM: build-image tag: release-v3.14.0
1:55:14 AM: buildbot version: 17781eb43cf82ba1890150fe75c9ab9320d6a721
1:55:14 AM: Fetching cached dependencies
1:55:14 AM: Starting to download cache of 379.6MB
1:55:17 AM: Finished downloading cache in 2.468437502s
1:55:17 AM: Starting to extract cache
1:55:28 AM: Finished extracting cache in 10.596420695s
1:55:28 AM: Finished fetching cache in 13.14260372s
1:55:28 AM: Starting to prepare the repo for build
1:55:28 AM: Preparing Git Reference refs/heads/master
1:55:29 AM: Parsing package.json dependencies
1:55:30 AM: Different functions path detected, going to use the one specified in the Netlify configuration file: ‘lambda’ versus ‘’ in the Netlify UI
1:55:30 AM: Different build command detected, going to use the one specified in the Netlify configuration file: ‘npm run build’ versus ‘yarn build’ in the Netlify UI
1:55:30 AM: Starting build script
1:55:30 AM: Installing dependencies
1:55:30 AM: Python version set to 2.7
1:55:30 AM: Started restoring cached node version
1:55:32 AM: Finished restoring cached node version
1:55:33 AM: v10.24.1 is already installed.
1:55:33 AM: Now using node v10.24.1 (npm v6.14.12)
1:55:33 AM: Started restoring cached build plugins
1:55:34 AM: Finished restoring cached build plugins
1:55:34 AM: Attempting ruby version 2.6.2, read from environment
1:55:35 AM: Using ruby version 2.6.2
1:55:35 AM: Using PHP version 5.6
1:55:35 AM: Started restoring cached yarn cache
1:55:35 AM: Finished restoring cached yarn cache
1:55:36 AM: Found yarn version (1.22.10) that doesn’t match expected (1.9.4)
up to date in 0.031s
1:55:36 AM: Installing yarn at version 1.9.4
1:55:36 AM: Installing Yarn!
1:55:36 AM: > Downloading tarball…
1:55:36 AM: [1/2]: https://yarnpkg.com/downloads/1.9.4/yarn-v1.9.4.tar.gz → /tmp/yarn.tar.gz.JP95o66uB8
1:55:36 AM: % Total % Received % Xferd Average Speed Time Time Time Current
1:55:36 AM: Dload Upload Total Spent Left Speed
1:55:36 AM: 0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0
1:55:36 AM: 100 77 100 77 0 0 442 0 --:–:-- --:–:-- --:–:-- 445
1:55:36 AM: 100 90 100 90 0 0 264 0 --:–:-- --:–:-- --:–:-- 264
1:55:37 AM: 0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0
1:55:37 AM: 0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0
1:55:37 AM: 100 915k 100 915k 0 0 879k 0 0:00:01 0:00:01 --:–:-- 879k
1:55:37 AM: [2/2]: https://yarnpkg.com/downloads/1.9.4/yarn-v1.9.4.tar.gz.asc → /tmp/yarn.tar.gz.JP95o66uB8.asc
1:55:37 AM: 100 81 100 81 0 0 575 0 --:–:-- --:–:-- --:–:-- 575
1:55:37 AM: 100 95 100 95 0 0 616 0 --:–:-- --:–:-- --:–:-- 616
1:55:37 AM: 0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0
1:55:37 AM: 100 832 100 832 0 0 4232 0 --:–:-- --:–:-- --:–:-- 4232
1:55:37 AM: > Verifying integrity…
1:55:37 AM: gpg: Signature made Fri 03 Aug 2018 07:53:36 PM UTC using RSA key ID B6FF4DE3
1:55:37 AM: gpg: Good signature from “Yarn Packaging yarn@dan.cx
1:55:37 AM: gpg: Note: This key has expired!
1:55:37 AM: Primary key fingerprint: 72EC F46A 56B4 AD39 C907 BBB7 1646 B01B 86E5 0310
1:55:37 AM: Subkey fingerprint: E219 30C4 D0A4 AA46 1858 1F7A E074 D16E B6FF 4DE3
1:55:37 AM: > GPG signature looks good
1:55:37 AM: > Extracting to ~/.yarn…
1:55:38 AM: > Adding to $PATH…
1:55:38 AM: > Successfully installed Yarn 1.9.4! Please open another terminal where the yarn command will now be available.
1:55:38 AM: No yarn workspaces detected
1:55:38 AM: Started restoring cached node modules
1:55:38 AM: Finished restoring cached node modules
1:55:39 AM: Installing NPM modules using Yarn version 1.9.4
1:55:39 AM: yarn install v1.9.4
1:55:39 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.
1:55:39 AM: [1/4] Resolving packages…
1:55:40 AM: [2/4] Fetching packages…
1:55:40 AM: (node:1370) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
1:56:14 AM: info fsevents@2.3.2: The platform “linux” is incompatible with this module.
1:56:14 AM: info “fsevents@2.3.2” is an optional dependency and failed compatibility check. Excluding it from installation.
1:56:14 AM: error sockjs-client@1.6.0: The engine “node” is incompatible with this module. Expected version “>=12”.
1:56:14 AM: error Found incompatible module
1:56:14 AM: info Visit yarn install | Yarn for documentation about this command.
1:56:14 AM: Error during Yarn install
1:56:14 AM: Build was terminated: Build script returned non-zero exit code: 1
1:56:14 AM: Creating deploy upload records
1:56:14 AM: Failing build: Failed to build site
1:56:15 AM: Failed during stage ‘building site’: Build script returned non-zero exit code: 1 (Search results for '"non-zero exit code: 1"' - Netlify Support Forums)
1:56:15 AM: Finished processing build request in 1m0.381222992s

:wave: @tbrusst , welcome to the community!

I believe the error and solution may be found in this log line:

Could you try removing package-lock.json and rebuilding and let us know if that clears up the error?