'gatsby build' works locally but not on Netlify

I can’t seem to figure out why my Gatsby application works on my machine but won’t deploy to Netlify.

Here are the build logs

10:54:03 PM: Build ready to start
10:54:05 PM: build-image version: 3571f0130496395a23bffe9820bc78b4f73a6234
10:54:05 PM: build-image tag: v3.7.0
10:54:05 PM: buildbot version: bd229cb35229750ceaca8bc031fa7f526aef77de
10:54:05 PM: Building without cache
10:54:05 PM: Starting to prepare the repo for build
10:54:05 PM: No cached dependencies found. Cloning fresh repo
10:54:05 PM: git clone
10:54:08 PM: Preparing Git Reference refs/heads/main
10:54:11 PM: Starting build script
10:54:11 PM: Installing dependencies
10:54:11 PM: Python version set to 2.7
10:54:12 PM: v12.18.0 is already installed.
10:54:12 PM: Now using node v12.18.0 (npm v6.14.4)
10:54:13 PM: Started restoring cached build plugins
10:54:13 PM: Finished restoring cached build plugins
10:54:13 PM: Attempting ruby version 2.7.1, read from environment
10:54:14 PM: Using ruby version 2.7.1
10:54:14 PM: Using PHP version 5.6
10:54:14 PM: Started restoring cached node modules
10:54:14 PM: Finished restoring cached node modules
10:54:15 PM: Installing NPM modules using NPM version 6.14.4
10:55:05 PM: > sharp@0.25.4 install /opt/build/repo/node_modules/sharp-cli/node_modules/sharp
10:55:05 PM: > (node install/libvips && node install/dll-copy && prebuild-install --runtime=napi) || (node-gyp rebuild && node install/dll-copy)
10:55:07 PM: info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.9.1/libvips-8.9.1-linux-x64.tar.gz
10:55:09 PM: > sharp@0.20.8 install /opt/build/repo/node_modules/sharp
10:55:09 PM: > (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
10:55:11 PM: info sharp Detected globally-installed libvips v8.6.2
10:55:11 PM: info sharp Building from source via node-gyp
10:55:15 PM: make: Entering directory ‘/opt/build/repo/node_modules/sharp/build’
10:55:15 PM: TOUCH Release/obj.target/libvips-cpp.stamp
10:55:15 PM: CXX(target) Release/obj.target/sharp/src/common.o
10:55:17 PM: In file included from …/src/common.cc:27:0:
10:55:17 PM: …/src/common.h:82:16: error: ‘Handle’ is not a member of ‘v8’
10:55:17 PM: bool HasAttr(v8::Handle<v8: :Object> obj, std::string attr);
10:55:17 PM: ^
10:55:17 PM: …/src/common.h:82:37: error: expected primary-expression before ‘>’ token
10:55:17 PM: bool HasAttr(v8::Handle obj, std::string attr);
10:55:17 PM: ^

10:55:17 PM: ^
10:55:17 PM: …/src/common.cc:609:1: error: expected ‘}’ at end of input
10:55:17 PM: } // namespace sharp
10:55:17 PM: ^
10:55:17 PM: sharp.target.mk:158: recipe for target ‘Release/obj.target/sharp/src/common.o’ failed
10:55:17 PM: make: *** [Release/obj.target/sharp/src/common.o] Error 1
10:55:17 PM: make: Leaving directory ‘/opt/build/repo/node_modules/sharp/build’
10:55:17 PM: gyp ERR! build error
10:55:17 PM: gyp ERR! stack Error: make failed with exit code: 2
10:55:17 PM: gyp ERR! stack at ChildProcess.onExit (/opt/buildhome/.nvm/versions/node/v12.18.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
10:55:17 PM: gyp ERR! stack at ChildProcess.emit (events.js:315:20)
10:55:17 PM: gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
10:55:17 PM: gyp ERR! System Linux 4.19.112+
10:55:17 PM: gyp ERR! command “/opt/buildhome/.nvm/versions/node/v12.18.0/bin/node” “/opt/buildhome/.nvm/versions/node/v12.18.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js” “rebuild”
10:55:17 PM: gyp ERR! cwd /opt/build/repo/node_modules/sharp
10:55:17 PM: gyp ERR! node -v v12.18.0
10:55:17 PM: gyp ERR! node-gyp -v v5.1.0
10:55:17 PM: gyp ERR! not ok
10:55:19 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/fsevents):
10:55:19 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
10:55:19 PM: npm ERR! code ELIFECYCLE
10:55:19 PM: npm ERR! errno 1
10:55:19 PM: npm ERR! sharp@0.20.8 install: (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
10:55:19 PM: npm ERR! Exit status 1
10:55:19 PM: npm ERR!
10:55:19 PM: npm ERR! Failed at the sharp@0.20.8 install script.
10:55:19 PM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
10:55:19 PM: npm ERR! A complete log of this run can be found in:
10:55:19 PM: npm ERR! /opt/buildhome/.npm/_logs/2021-03-19T03_55_19_460Z-debug.log
10:55:19 PM: Error during NPM install
10:55:19 PM: Build was terminated: Build script returned non-zero exit code: 1
10:55:19 PM: Failing build: Failed to build site
10:55:19 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 1
10:55:19 PM: Finished processing build request in 1m14.640104165s

Build settings

Base directory - Not set

Build command - gatsby build

Publish directory - public

Here is the complete log with all errors - I removed a large portion of the initial post due to repeated errors. Thanks in advance!!

10:54:03 PM: Build ready to start
10:54:05 PM: build-image version: 3571f0130496395a23bffe9820bc78b4f73a6234
10:54:05 PM: build-image tag: v3.7.0
10:54:05 PM: buildbot version: bd229cb35229750ceaca8bc031fa7f526aef77de
10:54:05 PM: Building without cache
10:54:05 PM: Starting to prepare the repo for build
10:54:05 PM: No cached dependencies found. Cloning fresh repo
10:54:05 PM: git clone GitHub - MrNoIce/Blog
10:54:08 PM: Preparing Git Reference refs/heads/main
10:54:11 PM: Starting build script
10:54:11 PM: Installing dependencies
10:54:11 PM: Python version set to 2.7
10:54:12 PM: v12.18.0 is already installed.
10:54:12 PM: Now using node v12.18.0 (npm v6.14.4)
10:54:13 PM: Started restoring cached build plugins
10:54:13 PM: Finished restoring cached build plugins
10:54:13 PM: Attempting ruby version 2.7.1, read from environment
10:54:14 PM: Using ruby version 2.7.1
10:54:14 PM: Using PHP version 5.6
10:54:14 PM: Started restoring cached node modules
10:54:14 PM: Finished restoring cached node modules
10:54:15 PM: Installing NPM modules using NPM version 6.14.4
10:55:05 PM: > sharp@0.25.4 install /opt/build/repo/node_modules/sharp-cli/node_modules/sharp
10:55:05 PM: > (node install/libvips && node install/dll-copy && prebuild-install --runtime=napi) || (node-gyp rebuild && node install/dll-copy)
10:55:07 PM: info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.9.1/libvips-8.9.1-linux-x64.tar.gz
10:55:09 PM: > sharp@0.20.8 install /opt/build/repo/node_modules/sharp
10:55:09 PM: > (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
10:55:11 PM: info sharp Detected globally-installed libvips v8.6.2
10:55:11 PM: info sharp Building from source via node-gyp
10:55:15 PM: make: Entering directory ‘/opt/build/repo/node_modules/sharp/build’
10:55:15 PM: TOUCH Release/obj.target/libvips-cpp.stamp
10:55:15 PM: CXX(target) Release/obj.target/sharp/src/common.o
10:55:17 PM: In file included from …/src/common.cc:27:0:
10:55:17 PM: …/src/common.h:82:16: error: ‘Handle’ is not a member of ‘v8’
10:55:17 PM: bool HasAttr(v8::Handle<v8: :Object> obj, std::string attr);
10:55:17 PM: ^
10:55:17 PM: …/src/common.h:82:37: error: expected primary-expression before ‘>’ token
10:55:17 PM: bool HasAttr(v8::Handle<v8: :Object> obj, std::string attr);
10:55:17 PM: ^
10:55:17 PM: …/src/common.h:82:39: error: ‘obj’ was not declared in this scope
10:55:17 PM: bool HasAttr(v8::Handle<v8: :Object> obj, std::string attr);
10:55:17 PM: ^
10:55:17 PM: …/src/common.h:82:56: error: expected primary-expression before ‘attr’
10:55:17 PM: bool HasAttr(v8:: Handle<v8:: Object> obj, std::string attr);
10:55:17 PM: ^
10:55:17 PM: …/src/common.h:82:60: error: expression list treated as compound expression in initializer [-fpermissive]
10:55:17 PM: bool HasAttr(v8::Handle<v8: :Object> obj, std::string attr);
10:55:17 PM: ^
10:55:17 PM: …/src/common.h:83:25: error: ‘Handle’ is not a member of ‘v8’
10:55:17 PM: std::string AttrAsStr(v8::Handle<v8: :Object> obj, std::string attr);
10:55:17 PM: ^
10:55:17 PM: …/src/common.h:83:46: error: expected primary-expression before ‘>’ token
10:55:17 PM: std::string AttrAsStr(v8::Handle<v8: :Object> obj, std::string attr);
10:55:17 PM: ^
10:55:17 PM: …/src/common.h:83:48: error: ‘obj’ was not declared in this scope
10:55:17 PM: std::string AttrAsStr(v8::Handle<v8: :Object> obj, std::string attr);
10:55:17 PM: ^
10:55:17 PM: …/src/common.h:83:65: error: expected primary-expression before ‘attr’
10:55:17 PM: std::string AttrAsStr(v8::Handle<v8: :Object> obj, std::string attr);
10:55:17 PM: ^
10:55:17 PM: …/src/common.h:84:44: error: ‘Handle’ is not a member of ‘v8’
10:55:17 PM: template v8::Local AttrAs(v8::Handle<v8:: Object> obj, std::string attr) {
10:55:17 PM: ^
10:55:17 PM: …/src/common.h:84:65: error: expected primary-expression before ‘>’ token
10:55:17 PM: template v8::Local AttrAs(v8::Handle<v8: :Object> obj, std::string attr) {
10:55:17 PM: ^
10:55:17 PM: …/src/common.h:84:67: error: ‘obj’ was not declared in this scope
10:55:17 PM: template v8::Local AttrAs(v8::Handle<v8: :Object> obj, std::string attr) {
10:55:17 PM: ^
10:55:17 PM: …/src/common.h:84:84: error: expected primary-expression before ‘attr’
10:55:17 PM: template v8::Local AttrAs(v8::Handle<v8:: Object> obj, std::string attr) {
10:55:17 PM: ^
10:55:17 PM: …/src/common.h:84:37: warning: variable templates only available with -std=c++14 or -std=gnu++14
10:55:17 PM: template v8::Local AttrAs(v8::Handle<v8: :Object> obj, std::string attr) {
10:55:17 PM: ^
10:55:17 PM: …/src/common.h:84:90: error: expected ‘;’ before ‘{’ token
10:55:17 PM: template v8::Local AttrAs(v8::Handle<v8: :Object> obj, std::string attr) {
10:55:17 PM: ^
10:55:17 PM: …/src/common.h:87:33: error: ‘Handle’ is not a member of ‘v8’
10:55:17 PM: template T AttrTo(v8::Handle<v8: :Object> obj, std::string attr) {
10:55:17 PM: ^
10:55:17 PM: …/src/common.h:87:54: error: expected primary-expression before ‘>’ token
10:55:17 PM: template T AttrTo(v8::Handle<v8: :Object> obj, std::string attr) {
10:55:17 PM: ^
10:55:17 PM: …/src/common.h:87:56: error: ‘obj’ was not declared in this scope
10:55:17 PM: template T AttrTo(v8::Handle<v8: :Object> obj, std::string attr) {
10:55:17 PM: ^
10:55:17 PM: …/src/common.h:87:73: error: expected primary-expression before ‘attr’
10:55:17 PM: template T AttrTo(v8::Handle<v8: :Object> obj, std::string attr) {
10:55:17 PM: ^
10:55:17 PM: …/src/common.h:87:26: warning: variable templates only available with -std=c++14 or -std=gnu++14
10:55:17 PM: template T AttrTo(v8::Handle<v8: :Object> obj, std::string attr) {
10:55:17 PM: ^
10:55:17 PM: …/src/common.h:87:79: error: expected ‘;’ before ‘{’ token
10:55:17 PM: template T AttrTo(v8::Handle<v8: :Object> obj, std::string attr) {
10:55:17 PM: ^
10:55:17 PM: …/src/common.h:90:33: error: ‘Handle’ is not a member of ‘v8’
10:55:17 PM: template T AttrTo(v8::Handle<v8: :Object> obj, int attr) {
10:55:17 PM: ^
10:55:17 PM: …/src/common.h:90:54: error: expected primary-expression before ‘>’ token
10:55:17 PM: template T AttrTo(v8::Handle<v8: :Object> obj, int attr) {
10:55:17 PM: ^
10:55:17 PM: …/src/common.h:90:56: error: ‘obj’ was not declared in this scope
10:55:17 PM: template T AttrTo(v8::Handle<v8: :Object> obj, int attr) {
10:55:17 PM: ^
10:55:17 PM: …/src/common.h:90:61: error: expected primary-expression before ‘int’
10:55:17 PM: template T AttrTo(v8::Handle<v8: :Object> obj, int attr) {
10:55:17 PM: ^
10:55:17 PM: …/src/common.h:87:26: warning: variable templates only available with -std=c++14 or -std=gnu++14
10:55:17 PM: template T AttrTo(v8::Handle<v8: :Object> obj, std::string attr) {
10:55:17 PM: ^
10:55:17 PM: …/src/common.h:90:71: error: expected ‘;’ before ‘{’ token
10:55:17 PM: template T AttrTo(v8: :Handle<v8: :Object> obj, int attr) {
10:55:17 PM: ^
10:55:17 PM: …/src/common.h:96:5: error: ‘Handle’ is not a member of ‘v8’
10:55:17 PM: v8::Handle<v8: :Object> input, std::vector<v8::Local<v8: :Object>> &buffersToPersist);
10:55:17 PM: ^
10:55:17 PM: …/src/common.h:96:26: error: expected primary-expression before ‘>’ token
10:55:17 PM: v8::Handle<v8: :Object> input, std::vector<v8::Local<v8:: Object>> &buffersToPersist);
10:55:17 PM: ^
10:55:17 PM: …/src/common.h:96:28: error: ‘input’ was not declared in this scope
10:55:17 PM: v8::Handle<v8: :Object> input, std::vector<v8::Local<v8:: Object>> &buffersToPersist);
10:55:17 PM: ^
10:55:17 PM: …/src/common.h:96:70: error: expected primary-expression before ‘&’ token
10:55:17 PM: v8::Handle<v8:: Object> input, std::vector<v8::Local<v8: :Object>> &buffersToPersist);
10:55:17 PM: ^
10:55:17 PM: …/src/common.h:96:71: error: ‘buffersToPersist’ was not declared in this scope
10:55:17 PM: v8::Handle<v8:: Object> input, std:: vector<v8::Local<v8: :Object>> &buffersToPersist);
10:55:17 PM: ^
10:55:17 PM: …/src/common.h:96:87: error: expression list treated as compound expression in initializer [-fpermissive]
10:55:17 PM: v8::Handle<v8:: Object> input, std::vector<v8: :Local<v8: :Object>> &buffersToPersist);
10:55:17 PM: ^
10:55:17 PM: …/src/common.cc:34:20: error: redefinition of ‘bool sharp::HasAttr’
10:55:17 PM: bool HasAttr(v8::Handle<v8:: Object> obj, std::string attr) {
10:55:17 PM: ^
10:55:17 PM: In file included from …/src/common.cc:27:0:
10:55:17 PM: …/src/common.h:82:8: note: ‘bool sharp::HasAttr’ previously defined here
10:55:17 PM: bool HasAttr(v8::Handle obj, std::string attr);
10:55:17 PM: ^
10:55:17 PM: …/src/common.cc:34:16: error: ‘Handle’ is not a member of ‘v8’
10:55:17 PM: bool HasAttr(v8::Handle<v8: :Object> obj, std::string attr) {
10:55:17 PM: ^
10:55:17 PM: …/src/common.cc:34:37: error: expected primary-expression before ‘>’ token
10:55:17 PM: bool HasAttr(v8::Handle<v8: :Object> obj, std::string attr) {
10:55:17 PM: ^
10:55:17 PM: …/src/common.cc:34:39: error: ‘obj’ was not declared in this scope
10:55:17 PM: bool HasAttr(v8::Handle obj, std::string attr) {
10:55:17 PM: ^
10:55:17 PM: …/src/common.cc:34:56: error: expected primary-expression before ‘attr’
10:55:17 PM: bool HasAttr(v8::Handle<v8: :Object> obj, std::string attr) {
10:55:17 PM: ^
10:55:17 PM: …/src/common.cc:37:29: error: redefinition of ‘std::__cxx11::string sharp::AttrAsStr’
10:55:17 PM: std::string AttrAsStr(v8::Handle<v8: :Object> obj, std::string attr) {
10:55:17 PM: ^
10:55:17 PM: In file included from …/src/common.cc:27:0:
10:55:17 PM: …/src/common.h:83:15: note: ‘std::__cxx11::string sharp::AttrAsStr’ previously declared here
10:55:17 PM: std::string AttrAsStr(v8::Handle<v8:: Object> obj, std::string attr);
10:55:17 PM: ^
10:55:17 PM: …/src/common.cc:37:25: error: ‘Handle’ is not a member of ‘v8’
10:55:17 PM: std::string AttrAsStr(v8::Handle<v8:: Object> obj, std::string attr) {
10:55:17 PM: ^
10:55:17 PM: …/src/common.cc:37:46: error: expected primary-expression before ‘>’ token
10:55:17 PM: std::string AttrAsStr(v8::Handle<v8:: Object> obj, std::string attr) {
10:55:17 PM: ^
10:55:17 PM: …/src/common.cc:37:48: error: ‘obj’ was not declared in this scope
10:55:17 PM: std::string AttrAsStr(v8::Handle<v8:: Object> obj, std::string attr) {
10:55:17 PM: ^
10:55:17 PM: …/src/common.cc:37:65: error: expected primary-expression before ‘attr’
10:55:17 PM: std::string AttrAsStr(v8::Handle<v8:: Object> obj, std::string attr) {
10:55:17 PM: ^
10:55:17 PM: …/src/common.cc:43:9: error: redefinition of ‘sharp::InputDescriptor* sharp::CreateInputDescriptor’
10:55:17 PM: v8::Handle<v8:: Object> input, std::vector<v8::Local<v8:: Object>> &buffersToPersist
10:55:17 PM: ^
10:55:17 PM: In file included from …/src/common.cc:27:0:
10:55:17 PM: …/src/common.h:95:20: note: ‘sharp::InputDescriptor* sharp::CreateInputDescriptor’ previously defined here
10:55:17 PM: InputDescriptor* CreateInputDescriptor(
10:55:17 PM: ^
10:55:17 PM: …/src/common.cc:43:5: error: ‘Handle’ is not a member of ‘v8’
10:55:17 PM: v8::Handle<v8:: Object> input, std::vector<v8::Local<v8:: Object>> &buffersToPersist
10:55:17 PM: ^
10:55:17 PM: …/src/common.cc:43:26: error: expected primary-expression before ‘>’ token
10:55:17 PM: v8::Handle<v8:: Object> input, std::vector<v8::Local<v8:: Object>> &buffersToPersist
10:55:17 PM: ^
10:55:17 PM: …/src/common.cc:43:28: error: ‘input’ was not declared in this scope
10:55:17 PM: v8::Handle<v8: :Object> input, std::vector<v8::Local<v8: :Object>> &buffersToPersist
10:55:17 PM: ^
10:55:17 PM: …/src/common.cc:43:70: error: expected primary-expression before ‘&’ token
10:55:17 PM: v8::Handle<v8:: Object> input, std::vector<v8::Local<v8:: Object>> &buffersToPersist
10:55:17 PM: ^
10:55:17 PM: …/src/common.cc:43:71: error: ‘buffersToPersist’ was not declared in this scope
10:55:17 PM: v8::Handle<v8:: Object> input, std::vector<v8::Local<v8:: Object>> &buffersToPersist
10:55:17 PM: ^
10:55:17 PM: …/src/common.cc:609:1: error: expected ‘}’ at end of input
10:55:17 PM: } // namespace sharp
10:55:17 PM: ^
10:55:17 PM: sharp.target.mk:158: recipe for target ‘Release/obj.target/sharp/src/common.o’ failed
10:55:17 PM: make: *** [Release/obj.target/sharp/src/common.o] Error 1
10:55:17 PM: make: Leaving directory ‘/opt/build/repo/node_modules/sharp/build’
10:55:17 PM: gyp ERR! build error
10:55:17 PM: gyp ERR! stack Error: make failed with exit code: 2
10:55:17 PM: gyp ERR! stack at ChildProcess.onExit (/opt/buildhome/.nvm/versions/node/v12.18.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
10:55:17 PM: gyp ERR! stack at ChildProcess.emit (events.js:315:20)
10:55:17 PM: gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
10:55:17 PM: gyp ERR! System Linux 4.19.112+
10:55:17 PM: gyp ERR! command “/opt/buildhome/.nvm/versions/node/v12.18.0/bin/node” “/opt/buildhome/.nvm/versions/node/v12.18.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js” “rebuild”
10:55:17 PM: gyp ERR! cwd /opt/build/repo/node_modules/sharp
10:55:17 PM: gyp ERR! node -v v12.18.0
10:55:17 PM: gyp ERR! node-gyp -v v5.1.0
10:55:17 PM: gyp ERR! not ok
10:55:19 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/fsevents):
10:55:19 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
10:55:19 PM: npm ERR! code ELIFECYCLE
10:55:19 PM: npm ERR! errno 1
10:55:19 PM: npm ERR! sharp@0.20.8 install: (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
10:55:19 PM: npm ERR! Exit status 1
10:55:19 PM: npm ERR!
10:55:19 PM: npm ERR! Failed at the sharp@0.20.8 install script.
10:55:19 PM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
10:55:19 PM: npm ERR! A complete log of this run can be found in:
10:55:19 PM: npm ERR! /opt/buildhome/.npm/_logs/2021-03-19T03_55_19_460Z-debug.log
10:55:19 PM: Error during NPM install
10:55:19 PM: Build was terminated: Build script returned non-zero exit code: 1
10:55:19 PM: Failing build: Failed to build site
10:55:19 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 1
10:55:19 PM: Finished processing build request in 1m14.640104165s

Hi, @jakescott. I’m getting the same error, even without using Netlify, so this isn’t anything related to our service. There is an issue with the site’s code and that will need to be resolved before the build at Netlify will succeed.

Your repo is public and this allowed me to tested it on a clean Ubuntu 20.04 VM and I get the same error there:

$ nvm use 12.18.
Now using node v12.18.0 (npm v6.14.4)
$ npm install
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!
npm WARN deprecated browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated babel-eslint@8.2.6: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
npm WARN deprecated babel-preset-es2015@6.24.1: 🙌  Thanks for using Babel: we recommend using babel-preset-env now: please read https://babeljs.io/env to update!
npm WARN deprecated bfj-node4@5.3.1: Switch to the `bfj` package for fixes and new features!
npm WARN deprecated cheerio-select-tmp@0.1.1: Use cheerio-select instead
npm WARN deprecated chokidar@1.7.0: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated core-js@2.6.12: 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.
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated extract-text-webpack-plugin@1.0.1: Deprecated. Please use https://github.com/webpack-contrib/mini-css-extract-plugin
npm WARN deprecated core-js@1.2.7: 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.
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated gatsby-image@1.0.55: This package has been deprecated in favor of gatsby-plugin-image. The migration guide can be found here: https://www.gatsbyjs.com/docs/reference/release-notes/image-migration-guide/.
npm WARN deprecated graphql-import@0.7.1: GraphQL Import has been deprecated and merged into GraphQL Tools, so it will no longer get updates. Use GraphQL Tools instead to stay up-to-date! Check out https://www.graphql-tools.com/docs/migration-from-import for migration and https://the-guild.dev/blog/graphql-tools-v6 for new changes.
npm WARN deprecated gulp-util@3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated hoek@5.0.4: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated items@2.1.2: This module has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version of hapi to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated joi@12.0.0: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated hoek@4.2.1: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated pkg-resolve@0.1.14: Not maintained anymore.
npm WARN deprecated popper.js@1.16.1: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1
npm WARN deprecated postcss-cssnext@2.11.0: 'postcss-cssnext' has been deprecated in favor of 'postcss-preset-env'. Read more at https://moox.io/blog/deprecating-cssnext/
npm WARN deprecated redux-devtools-core@0.2.1: Package moved to @redux-devtools/app.
npm WARN deprecated redux-devtools-instrument@1.10.0: Package moved to @redux-devtools/instrument.
npm WARN deprecated remotedev-serialize@0.1.9: Package moved to @redux-devtools/serialize.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated sw-precache@5.2.1: Please migrate to Workbox: https://developers.google.com/web/tools/workbox/guides/migrations/migrate-from-sw
npm WARN deprecated sw-toolbox@3.6.0: Please migrate to Workbox: https://developers.google.com/web/tools/workbox/guides/migrations/migrate-from-sw
npm WARN deprecated topo@2.0.2: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated joi@9.0.0-0: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).

> sharp@0.25.4 install /home/username/tmp/Blog/node_modules/sharp-cli/node_modules/sharp
> (node install/libvips && node install/dll-copy && prebuild-install --runtime=napi) || (node-gyp rebuild && node install/dll-copy)

info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.9.1/libvips-8.9.1-linux-x64.tar.gz

> sharp@0.20.8 install /home/username/tmp/Blog/node_modules/sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)

info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.6.1/libvips-8.6.1-linux-x64.tar.gz
prebuild-install WARN install No prebuilt binaries found (target=12.18.0 runtime=node arch=x64 platform=linux)
make: Entering directory '/home/username/tmp/Blog/node_modules/sharp/build'
  TOUCH Release/obj.target/libvips-cpp.stamp
  CXX(target) Release/obj.target/sharp/src/common.o
In file included from ../src/common.cc:27:
../src/common.h:82:20: error: ‘Handle’ is not a member of ‘v8’
   82 |   bool HasAttr(v8::Handle<v8::Object> obj, std::string attr);
      |                    ^~~~~~
../src/common.h:82:37: error: expected primary-expression before ‘>’ token
   82 |   bool HasAttr(v8::Handle<v8::Object> obj, std::string attr);
      |                                     ^
../src/common.h:82:39: error: ‘obj’ was not declared in this scope
   82 |   bool HasAttr(v8::Handle<v8::Object> obj, std::string attr);
      |                                       ^~~
../src/common.h:82:56: error: expected primary-expression before ‘attr’
   82 |   bool HasAttr(v8::Handle<v8::Object> obj, std::string attr);
      |                                                        ^~~~
../src/common.h:82:60: error: expression list treated as compound expression in initializer [-fpermissive]
   82 |   bool HasAttr(v8::Handle<v8::Object> obj, std::string attr);
      |                                                            ^
../src/common.h:83:29: error: ‘Handle’ is not a member of ‘v8’
   83 |   std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr);
      |                             ^~~~~~
../src/common.h:83:46: error: expected primary-expression before ‘>’ token
   83 |   std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr);
      |                                              ^
../src/common.h:83:48: error: ‘obj’ was not declared in this scope
   83 |   std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr);
      |                                                ^~~
../src/common.h:83:65: error: expected primary-expression before ‘attr’
   83 |   std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr);
      |                                                                 ^~~~
../src/common.h:84:48: error: ‘Handle’ is not a member of ‘v8’
   84 |   template<typename T> v8::Local<T> AttrAs(v8::Handle<v8::Object> obj, std::string attr) {
      |                                                ^~~~~~
../src/common.h:84:65: error: expected primary-expression before ‘>’ token
   84 |   template<typename T> v8::Local<T> AttrAs(v8::Handle<v8::Object> obj, std::string attr) {
      |                                                                 ^
../src/common.h:84:67: error: ‘obj’ was not declared in this scope
   84 |   template<typename T> v8::Local<T> AttrAs(v8::Handle<v8::Object> obj, std::string attr) {
      |                                                                   ^~~
../src/common.h:84:84: error: expected primary-expression before ‘attr’
   84 |   template<typename T> v8::Local<T> AttrAs(v8::Handle<v8::Object> obj, std::string attr) {
      |                                                                                    ^~~~
../src/common.h:84:37: warning: variable templates only available with ‘-std=c++14’ or ‘-std=gnu++14’
   84 |   template<typename T> v8::Local<T> AttrAs(v8::Handle<v8::Object> obj, std::string attr) {
      |                                     ^~~~~~
../src/common.h:84:89: error: expected ‘;’ before ‘{’ token
   84 |   template<typename T> v8::Local<T> AttrAs(v8::Handle<v8::Object> obj, std::string attr) {
      |                                                                                         ^~
      |                                                                                         ;
../src/common.h:87:37: error: ‘Handle’ is not a member of ‘v8’
   87 |   template<typename T> T AttrTo(v8::Handle<v8::Object> obj, std::string attr) {
      |                                     ^~~~~~
../src/common.h:87:54: error: expected primary-expression before ‘>’ token
   87 |   template<typename T> T AttrTo(v8::Handle<v8::Object> obj, std::string attr) {
      |                                                      ^
../src/common.h:87:56: error: ‘obj’ was not declared in this scope
   87 |   template<typename T> T AttrTo(v8::Handle<v8::Object> obj, std::string attr) {
      |                                                        ^~~
../src/common.h:87:73: error: expected primary-expression before ‘attr’
   87 |   template<typename T> T AttrTo(v8::Handle<v8::Object> obj, std::string attr) {
      |                                                                         ^~~~
../src/common.h:87:26: warning: variable templates only available with ‘-std=c++14’ or ‘-std=gnu++14’
   87 |   template<typename T> T AttrTo(v8::Handle<v8::Object> obj, std::string attr) {
      |                          ^~~~~~
../src/common.h:87:78: error: expected ‘;’ before ‘{’ token
   87 |   template<typename T> T AttrTo(v8::Handle<v8::Object> obj, std::string attr) {
      |                                                                              ^~
      |                                                                              ;
../src/common.h:90:37: error: ‘Handle’ is not a member of ‘v8’
   90 |   template<typename T> T AttrTo(v8::Handle<v8::Object> obj, int attr) {
      |                                     ^~~~~~
../src/common.h:90:54: error: expected primary-expression before ‘>’ token
   90 |   template<typename T> T AttrTo(v8::Handle<v8::Object> obj, int attr) {
      |                                                      ^
../src/common.h:90:56: error: ‘obj’ was not declared in this scope
   90 |   template<typename T> T AttrTo(v8::Handle<v8::Object> obj, int attr) {
      |                                                        ^~~
../src/common.h:90:61: error: expected primary-expression before ‘int’
   90 |   template<typename T> T AttrTo(v8::Handle<v8::Object> obj, int attr) {
      |                                                             ^~~
../src/common.h:87:26: warning: variable templates only available with ‘-std=c++14’ or ‘-std=gnu++14’
   87 |   template<typename T> T AttrTo(v8::Handle<v8::Object> obj, std::string attr) {
      |                          ^~~~~~
../src/common.h:90:70: error: expected ‘;’ before ‘{’ token
   90 |   template<typename T> T AttrTo(v8::Handle<v8::Object> obj, int attr) {
      |                                                                      ^~
      |                                                                      ;
../src/common.h:96:9: error: ‘Handle’ is not a member of ‘v8’
   96 |     v8::Handle<v8::Object> input, std::vector<v8::Local<v8::Object>> &buffersToPersist);
      |         ^~~~~~
../src/common.h:96:26: error: expected primary-expression before ‘>’ token
   96 |     v8::Handle<v8::Object> input, std::vector<v8::Local<v8::Object>> &buffersToPersist);
      |                          ^
../src/common.h:96:28: error: ‘input’ was not declared in this scope
   96 |     v8::Handle<v8::Object> input, std::vector<v8::Local<v8::Object>> &buffersToPersist);
      |                            ^~~~~
../src/common.h:96:70: error: expected primary-expression before ‘&’ token
   96 |     v8::Handle<v8::Object> input, std::vector<v8::Local<v8::Object>> &buffersToPersist);
      |                                                                      ^
../src/common.h:96:71: error: ‘buffersToPersist’ was not declared in this scope
   96 |     v8::Handle<v8::Object> input, std::vector<v8::Local<v8::Object>> &buffersToPersist);
      |                                                                       ^~~~~~~~~~~~~~~~
../src/common.h:96:87: error: expression list treated as compound expression in initializer [-fpermissive]
   96 |     v8::Handle<v8::Object> input, std::vector<v8::Local<v8::Object>> &buffersToPersist);
      |                                                                                       ^
../src/common.cc:34:8: error: redefinition of ‘bool sharp::HasAttr’
   34 |   bool HasAttr(v8::Handle<v8::Object> obj, std::string attr) {
      |        ^~~~~~~
In file included from ../src/common.cc:27:
../src/common.h:82:8: note: ‘bool sharp::HasAttr’ previously defined here
   82 |   bool HasAttr(v8::Handle<v8::Object> obj, std::string attr);
      |        ^~~~~~~
../src/common.cc:34:20: error: ‘Handle’ is not a member of ‘v8’
   34 |   bool HasAttr(v8::Handle<v8::Object> obj, std::string attr) {
      |                    ^~~~~~
../src/common.cc:34:37: error: expected primary-expression before ‘>’ token
   34 |   bool HasAttr(v8::Handle<v8::Object> obj, std::string attr) {
      |                                     ^
../src/common.cc:34:39: error: ‘obj’ was not declared in this scope
   34 |   bool HasAttr(v8::Handle<v8::Object> obj, std::string attr) {
      |                                       ^~~
../src/common.cc:34:56: error: expected primary-expression before ‘attr’
   34 |   bool HasAttr(v8::Handle<v8::Object> obj, std::string attr) {
      |                                                        ^~~~
../src/common.cc:37:15: error: redefinition of ‘std::string sharp::AttrAsStr’
   37 |   std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr) {
      |               ^~~~~~~~~
In file included from ../src/common.cc:27:
../src/common.h:83:15: note: ‘std::string sharp::AttrAsStr’ previously declared here
   83 |   std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr);
      |               ^~~~~~~~~
../src/common.cc:37:29: error: ‘Handle’ is not a member of ‘v8’
   37 |   std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr) {
      |                             ^~~~~~
../src/common.cc:37:46: error: expected primary-expression before ‘>’ token
   37 |   std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr) {
      |                                              ^
../src/common.cc:37:48: error: ‘obj’ was not declared in this scope
   37 |   std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr) {
      |                                                ^~~
../src/common.cc:37:65: error: expected primary-expression before ‘attr’
   37 |   std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr) {
      |                                                                 ^~~~
../src/common.cc:42:20: error: redefinition of ‘sharp::InputDescriptor* sharp::CreateInputDescriptor’
   42 |   InputDescriptor* CreateInputDescriptor(
      |                    ^~~~~~~~~~~~~~~~~~~~~
In file included from ../src/common.cc:27:
../src/common.h:95:20: note: ‘sharp::InputDescriptor* sharp::CreateInputDescriptor’ previously defined here
   95 |   InputDescriptor* CreateInputDescriptor(
      |                    ^~~~~~~~~~~~~~~~~~~~~
../src/common.cc:43:9: error: ‘Handle’ is not a member of ‘v8’
   43 |     v8::Handle<v8::Object> input, std::vector<v8::Local<v8::Object>> &buffersToPersist
      |         ^~~~~~
../src/common.cc:43:26: error: expected primary-expression before ‘>’ token
   43 |     v8::Handle<v8::Object> input, std::vector<v8::Local<v8::Object>> &buffersToPersist
      |                          ^
../src/common.cc:43:28: error: ‘input’ was not declared in this scope
   43 |     v8::Handle<v8::Object> input, std::vector<v8::Local<v8::Object>> &buffersToPersist
      |                            ^~~~~
../src/common.cc:43:70: error: expected primary-expression before ‘&’ token
   43 |     v8::Handle<v8::Object> input, std::vector<v8::Local<v8::Object>> &buffersToPersist
      |                                                                      ^
../src/common.cc:43:71: error: ‘buffersToPersist’ was not declared in this scope
   43 |     v8::Handle<v8::Object> input, std::vector<v8::Local<v8::Object>> &buffersToPersist
      |                                                                       ^~~~~~~~~~~~~~~~
make: *** [sharp.target.mk:136: Release/obj.target/sharp/src/common.o] Error 1
make: Leaving directory '/home/username/tmp/Blog/node_modules/sharp/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/username/.nvm/versions/node/v12.18.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Linux 5.4.0-66-generic
gyp ERR! command "/home/username/.nvm/versions/node/v12.18.0/bin/node" "/home/username/.nvm/versions/node/v12.18.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/username/tmp/Blog/node_modules/sharp
gyp ERR! node -v v12.18.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm WARN @material-ui/core@1.5.1 requires a peer of react@^16.3.0 but none is installed. You must install peer dependencies yourself.
npm WARN @material-ui/core@1.5.1 requires a peer of react-dom@^16.3.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-event-listener@0.6.6 requires a peer of react@^16.3.0 but none is installed. You must install peer dependencies yourself.
npm WARN @material-ui/icons@1.1.1 requires a peer of react@^16.3.0 but none is installed. You must install peer dependencies yourself.
npm WARN @material-ui/icons@1.1.1 requires a peer of react-dom@^16.3.0 but none is installed. You must install peer dependencies yourself.
npm WARN acorn-jsx@5.3.1 requires a peer of acorn@^6.0.0 || ^7.0.0 || ^8.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-plugin-graphql@2.1.1 requires a peer of graphql@^0.12.0 || ^0.13.0 but none is installed. You must install peer dependencies yourself.
npm WARN friendly-errors-webpack-plugin@1.7.0 requires a peer of webpack@^2.0.0 || ^3.0.0 || ^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-instantsearch-native@5.7.0 requires a peer of react-native@>= 0.32.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sharp@0.20.8 install: `(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sharp@0.20.8 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/username/.npm/_logs/2021-03-22T04_46_58_280Z-debug.log

So, there is an issue building your site on Ubuntu, which is the OS the build image uses. You will need to resolve this error above before the build at Netlify will succeed.

If you want to test this build in our build image, you can do so using the instructions found here:

If there are other questions, please let us know.

@luke Thank you so much for your response! After many attempts to change my dependancies, I realized I needed to use a different version of node. I was able to replicate it locally once I changed the node version to reflect what netlify was using. I passed in the NODE_VERSION variable that I needed inside of netlify and everything worked!

1 Like

Hey there, @jakescott!

So glad to hear you got it working. Thank you for sharing your steps with us.