Repo clone not deploying -- Build script returned non-zero exit code: 1

I just cloned the git repo of a website that’s running fine and also hosted on Netlify. The cloned site however isn’t deploying and I’m getting the following error:
Failed during stage ‘building site’: Build script returned non-zero exit code: 1

Fwiw I’ve deployed clones of this site on Netlify previously and never had an issue. All git repos are hosted and being deployed from Gitlab. The link to the current website: https://laughing-mayer-b18c6b.netlify.app/

Would appreciate any help or ideas. (I’ve read through all forum posts with a similar error but haven’t seen a fix that worked)

Full build log was really long but I’ve added the most relevant parts (I think) below:

11:32:42 PM: Build ready to start
11:32:43 PM: build-image version: b0258b965567defc4a2d7e2f2dec2e00c8f73ad6
11:32:43 PM: build-image tag: v3.4.1
11:32:43 PM: buildbot version: fcbc7a79f7372e5995cf02954ef19fc48d20c871
11:32:44 PM: Fetching cached dependencies
11:32:44 PM: Failed to fetch cache, continuing with build
11:32:44 PM: Starting to prepare the repo for build
11:32:44 PM: No cached dependencies found. Cloning fresh repo
11:32:44 PM: git clone git@gitlab.com:username/slug
11:32:45 PM: Preparing Git Reference refs/heads/master
11:32:46 PM: Different publish path detected, going to use the one specified in the Netlify configuration file: ‘public’ versus ‘public/’ in the Netlify UI
11:32:47 PM: Starting build script
11:32:47 PM: Installing dependencies
11:32:47 PM: Python version set to 2.7
11:32:48 PM: v12.18.0 is already installed.
11:32:49 PM: Now using node v12.18.0 (npm v6.14.4)
11:32:49 PM: Started restoring cached build plugins
11:32:49 PM: Finished restoring cached build plugins
11:32:49 PM: Attempting ruby version 2.7.1, read from environment
11:32:50 PM: Using ruby version 2.7.1
11:32:50 PM: Using PHP version 5.6
11:32:51 PM: 5.2 is already installed.
11:32:51 PM: Using Swift version 5.2
11:32:51 PM: Started restoring cached node modules
11:32:51 PM: Finished restoring cached node modules
11:32:51 PM: Started restoring cached yarn cache
11:32:51 PM: Finished restoring cached yarn cache
11:32:51 PM: Installing yarn at version 1.22.4
11:32:51 PM: Installing Yarn!
11:32:51 PM: > Downloading tarball…
11:32:51 PM: [1/2]: https://yarnpkg.com/downloads/1.22.4/yarn-v1.22.4.tar.gz --> /tmp/yarn.tar.gz.cm9bJ9RJjA
11:32:51 PM: % Total % Received % Xferd Average Speed Time Time Time Current
11:32:51 PM: Dload Upload Total Spent Left Speed
11:32:51 PM: 0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0
11:32:51 PM: 100 80 100 80 0 0 204 0 --:–:-- --:–:-- --:–:-- 205
11:32:51 PM: 0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0
11:32:51 PM: 100 93 100 93 0 0 110 0 --:–:-- --:–:-- --:–:-- 286
11:32:52 PM: 100 643 100 643 0 0 509 0 0:00:01 0:00:01 --:–:-- 509
11:32:52 PM: 0 0 0 0 0 0 0 0 --:–:-- 0:00:01 --:–:-- 0
11:32:52 PM: 100 1215k 100 1215k 0 0 696k 0 0:00:01 0:00:01 --:–:-- 4693k
11:32:52 PM: [2/2]: https://yarnpkg.com/downloads/1.22.4/yarn-v1.22.4.tar.gz.asc --> /tmp/yarn.tar.gz.cm9bJ9RJjA.asc
11:32:52 PM: 100 84 100 84 0 0 1987 0 --:–:-- --:–:-- --:–:-- 1987
11:32:52 PM: 100 97 100 97 0 0 1139 0 --:–:-- --:–:-- --:–:-- 1139
11:32:53 PM: 100 647 100 647 0 0 2890 0 --:–:-- --:–:-- --:–:-- 2890
11:32:53 PM: 100 1028 100 1028 0 0 3807 0 --:–:-- --:–:-- --:–:-- 3807
11:32:53 PM: > Verifying integrity…
11:32:53 PM: gpg: Signature made Mon 09 Mar 2020 03:52:13 PM UTC using RSA key ID 69475BAA
11:32:53 PM: gpg: Good signature from “Yarn Packaging yarn@dan.cx
11:32:53 PM: gpg: WARNING: This key is not certified with a trusted signature!
11:32:53 PM: gpg: There is no indication that the signature belongs to the owner.
11:32:53 PM: Primary key fingerprint: 72EC F46A 56B4 AD39 C907 BBB7 1646 B01B 86E5 0310
11:32:53 PM: Subkey fingerprint: 6D98 490C 6F1A CDDD 448E 4595 4F77 6793 6947 5BAA
11:32:53 PM: > GPG signature looks good
11:32:53 PM: > Extracting to ~/.yarn…
11:32:53 PM: > Adding to $PATH…
11:32:53 PM: > Successfully installed Yarn 1.22.4! Please open another terminal where the yarn command will now be available.
11:32:53 PM: Installing NPM modules using Yarn version 1.22.4
11:32:54 PM: yarn install v1.22.4
11:32:54 PM: [1/4] Resolving packages…
11:32:55 PM: [2/4] Fetching packages…
11:32:58 PM: warning mini-css-extract-plugin@0.4.5: Invalid bin field for “mini-css-extract-plugin”.
11:32:59 PM: warning url-loader@1.1.2: Invalid bin field for “url-loader”.
11:33:15 PM: [1/5] Validating package.json…
11:33:15 PM: [2/5] Resolving packages…
11:33:16 PM: [3/5] Fetching packages…
11:33:31 PM: info fsevents@1.2.7: The platform “linux” is incompatible with this module.
11:33:31 PM: info “fsevents@1.2.7” is an optional dependency and failed compatibility check. Excluding it from installation.
11:33:31 PM: [4/5] Linking dependencies…
11:33:39 PM: [5/5] Building fresh packages…
11:35:50 PM: error /opt/build/.yarn_cache/v6/.tmp/3519303344d52340e3f72d63ab558bd7.dba85b2a11e7eade37b26319e51e36fff398a4c3.prepare/node_modules/node-sass: Command failed.
11:35:50 PM: Exit code: 1
11:35:50 PM: Command: node scripts/build.js
11:35:50 PM: Arguments:
11:35:50 PM: Directory: /opt/build/.yarn_cache/v6/.tmp/3519303344d52340e3f72d63ab558bd7.dba85b2a11e7eade37b26319e51e36fff398a4c3.prepare/node_modules/node-sass
11:35:50 PM: Output:
11:35:50 PM: Building: /opt/buildhome/.nvm/versions/node/v12.18.0/bin/node /opt/build/.yarn_cache/v6/.tmp/3519303344d52340e3f72d63ab558bd7.dba85b2a11e7eade37b26319e51e36fff398a4c3.prepare/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
11:35:50 PM: gyp info it worked if it ends with ok
11:35:50 PM: gyp verb cli [
11:35:50 PM: gyp verb cli ‘/opt/buildhome/.nvm/versions/node/v12.18.0/bin/node’,
11:35:50 PM: gyp verb cli ‘/opt/build/.yarn_cache/v6/.tmp/3519303344d52340e3f72d63ab558bd7.dba85b2a11e7eade37b26319e51e36fff398a4c3.prepare/node_modules/node-gyp/bin/node-gyp.js’,
11:35:50 PM: gyp verb cli ‘rebuild’,
11:35:50 PM: gyp verb cli ‘–verbose’,
11:35:50 PM: gyp verb cli ‘–libsass_ext=’,
11:35:50 PM: gyp verb cli ‘–libsass_cflags=’,
11:35:50 PM: gyp verb cli ‘–libsass_ldflags=’,
11:35:50 PM: gyp verb cli ‘–libsass_library=’
11:35:50 PM: gyp verb cli ]
.
.
.
11:35:50 PM: return val->NAME ## Value(isolate->GetCurrentContext());
11:35:50 PM: ^
11:35:50 PM: …/…/nan/nan_converters_43_inl.h:40:1: note: in expansion of macro ‘X’
11:35:50 PM: X(bool, Boolean)
11:35:50 PM: ^
11:35:50 PM: In file included from /opt/buildhome/.node-gyp/12.18.0/include/node/v8-internal.h:14:0,
11:35:50 PM: from /opt/buildhome/.node-gyp/12.18.0/include/node/v8.h:27,
11:35:50 PM: from /opt/buildhome/.node-gyp/12.18.0/include/node/node.h:67,
11:35:50 PM: from …/…/nan/nan.h:53,
11:35:50 PM: from …/src/binding.cpp:1:
11:35:50 PM: /opt/buildhome/.node-gyp/12.18.0/include/node/v8.h:2702:51: note: declared here
11:35:50 PM: V8_WARN_UNUSED_RESULT Maybe BooleanValue(
11:35:50 PM: ^
11:35:50 PM: /opt/buildhome/.node-gyp/12.18.0/include/node/v8config.h:328:3: note: in definition of macro ‘V8_DEPRECATED’
11:35:50 PM: declarator attribute((deprecated(message)))
11:35:50 PM: ^
11:35:50 PM: In file included from …/…/nan/nan_new.h:189:0,
11:35:50 PM: from …/…/nan/nan.h:223,
11:35:50 PM: from …/src/binding.cpp:1:
11:35:50 PM: …/…/nan/nan_implementation_12_inl.h: In static member function ‘static Nan::imp::FactoryBasev8::StringObject::return_t Nan::imp::Factoryv8::StringObject::New(v8::Localv8::String)’:
11:35:50 PM: …/…/nan/nan_implementation_12_inl.h:356:37: error: no matching function for call to ‘v8::StringObject::New(v8::Localv8::String&)’
11:35:50 PM: return v8::StringObject::New(value).Asv8::StringObject();
11:35:50 PM: ^
11:35:50 PM: In file included from /opt/buildhome/.node-gyp/12.18.0/include/node/node.h:67:0,
11:35:50 PM: from …/…/nan/nan.h:53,
11:35:50 PM: from …/src/binding.cpp:1:
11:35:50 PM: /opt/buildhome/.node-gyp/12.18.0/include/node/v8.h:5531:23: note: candidate: static v8::Localv8::Value v8::StringObject::New(v8::Isolate*, v8::Localv8::String)
11:35:50 PM: static Local New(Isolate* isolate, Local value);
11:35:50 PM: ^
11:35:50 PM: /opt/buildhome/.node-gyp/12.18.0/include/node/v8.h:5531:23: note: candidate expects 2 arguments, 1 provided
11:35:50 PM: In file included from …/…/nan/nan_new.h:189:0,
11:35:50 PM: from …/…/nan/nan.h:223,
11:35:50 PM: from …/src/binding.cpp:1:
11:35:50 PM: …/…/nan/nan_implementation_12_inl.h:356:58: error: expected primary-expression before ‘>’ token
11:35:50 PM: return v8::StringObject::New(value).Asv8::StringObject();
11:35:50 PM: ^
11:35:50 PM: …/…/nan/nan_implementation_12_inl.h:356:60: error: expected primary-expression before ‘)’ token
11:35:50 PM: return v8::StringObject::New(value).Asv8::StringObject();
11:35:50 PM: ^
11:35:50 PM: In file included from /usr/include/c++/5/cassert:43:0,
11:35:50 PM: from /opt/buildhome/.node-gyp/12.18.0/include/node/node_object_wrap.h:26,
11:35:50 PM: from …/…/nan/nan.h:55,
11:35:50 PM: from …/src/binding.cpp:1:
11:35:50 PM: …/…/nan/nan_object_wrap.h: In destructor ‘virtual Nan::ObjectWrap::~ObjectWrap()’:
11:35:50 PM: …/…/nan/nan_object_wrap.h:24:25: error: ‘class Nan::Persistentv8::Object’ has no member named ‘IsNearDeath’
11:35:50 PM: assert(persistent().IsNearDeath());
11:35:50 PM: ^
11:35:50 PM: …/…/nan/nan_object_wrap.h: In static member function ‘static void Nan::ObjectWrap::WeakCallback(const v8::WeakCallbackInfoNan::ObjectWrap&)’:
11:35:50 PM: …/…/nan/nan_object_wrap.h:127:26: error: ‘class Nan::Persistentv8::Object’ has no member named ‘IsNearDeath’
11:35:50 PM: assert(wrap->handle_.IsNearDeath());
11:35:50 PM: ^
11:35:50 PM: binding.target.mk:131: recipe for target ‘Release/obj.target/binding/src/binding.o’ failed
11:35:50 PM: make: Leaving directory ‘/opt/build/.yarn_cache/v6/.tmp/3519303344d52340e3f72d63ab558bd7.dba85b2a11e7eade37b26319e51e36fff398a4c3.prepare/node_modules/node-sass/build’
11:35:50 PM: make: *** [Release/obj.target/binding/src/binding.o] Error 1
11:35:50 PM: gyp ERR! build error
11:35:50 PM: gyp ERR! stack Error: make failed with exit code: 2
11:35:50 PM: gyp ERR! stack at ChildProcess.onExit (/opt/build/.yarn_cache/v6/.tmp/3519303344d52340e3f72d63ab558bd7.dba85b2a11e7eade37b26319e51e36fff398a4c3.prepare/node_modules/node-gyp/lib/build.js:262:23)
11:35:50 PM: gyp ERR! stack at ChildProcess.emit (events.js:315:20)
11:35:50 PM: gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
11:35:50 PM: gyp ERR! System Linux 4.14.138+
11:35:50 PM: gyp ERR! command “/opt/buildhome/.nvm/versions/node/v12.18.0/bin/node” “/opt/build/.yarn_cache/v6/.tmp/3519303344d52340e3f72d63ab558bd7.dba85b2a11e7eade37b26319e51e36fff398a4c3.prepare/node_modules/node-gyp/bin/node-gyp.js” “rebuild” “–verbose” “–libsass_ext=” “–libsass_cflags=” “–libsass_ldflags=” “–libsass_library=”
11:35:50 PM: gyp ERR! cwd /opt/build/.yarn_cache/v6/.tmp/3519303344d52340e3f72d63ab558bd7.dba85b2a11e7eade37b26319e51e36fff398a4c3.prepare/node_modules/node-sass
11:35:50 PM: gyp ERR! node -v v12.18.0
11:35:50 PM: gyp ERR! node-gyp -v v3.8.0
11:35:50 PM: gyp ERR! not ok
11:35:50 PM: Build failed with error code: 1
11:35:50 PM: Error during Yarn install
11:35:50 PM: Error running command: Build script returned non-zero exit code: 1
11:35:50 PM: Failing build: Failed to build site
11:35:50 PM: Finished processing build request in 3m6.902699636s

hmm, reads like we are having trouble getting a working version of node sass for some reason.

Are you deploying your node_modules folder, or trying to? (you shouldn’t)

Does the error persist if you try “clear cache and redeploy”?

I’m not deploying node_modules, the .gitignore file lists ‘node_modules/’

Error is still persisting even after ‘clear cache and redeploy’ (tried 4 times, I assume you have access to it too?)

I think I’m most confused since the repo is an exact clone running the same build command etc so can’t figure out what’s even different to be getting this error

.gitignore has nothing to do with what we deploy, just as an FYI - it just affects what you push.

If your build creates a node_modules/ hierarchy, in the deploy aka “publish” directory, we could very well try to deploy it regardless of what .gitignore says.

I doubt that is the situation here though :slight_smile:!

Haven’t seen quite that error before, but could I confirm that you’ve synced our versions of node and yarn with what you’re using locally? That’s always a good first step. I think you have since I see some custom versions in your logs:

11:32:49 PM: Now using node v12.18.0 (npm v6.14.4)
[...]
11:32:51 PM: Installing yarn at version 1.22.4

Just wanted to make sure.

Assuming yes or you do so without changed behavior in the build, if you could point me to the other site that does work, I could check our internal settings for both to find differences, and potentially diff the logs a bit to help understand the difference.

Thanks for clarifying. Just sharing the links to the other sites by message

I’m sorry, I can’t provide support via DM. Please let us know in the comments here! Deploy and Site ID’s are safe to share publicly.