Gatsby Build Issue Works Local but Fails on Netlify

I have an issue with a build working locally and failing on Netlify. My Gatsby version is 2.0.73. Here is the error log snippet:

Installing NPM modules using NPM version 6.14.4

11:14:27 AM: > sharp@0.21.3 install /opt/build/repo/node_modules/sharp

11:14:27 AM: > (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)

11:14:27 AM: info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.7.0/libvips-8.7.0-linux-x64.tar.gz

11:14:29 AM: prebuild-install WARN install No prebuilt binaries found (target=12.18.0 runtime=node arch=x64 libc= platform=linux)

11:14:30 AM: make: Entering directory ‘/opt/build/repo/node_modules/sharp/build’

11:14:30 AM: TOUCH Release/obj.target/libvips-cpp.stamp

11:14:30 AM: CXX(target) Release/obj.target/sharp/src/common.o

11:14:32 AM: In file included from …/src/common.cc:27:0:

11:14:32 AM: …/src/common.h:78:16: error: ‘Handle’ is not a member of ‘v8’

11:14:32 AM: bool HasAttr(v8::Handlev8::Object obj, std::string attr);

Any guidance would be appreciated.

Hey @danwade0,
Could you please try setting the NODE_VERSION environment variable in the Netlify UI to be the same version that you’re using locally? Here are our docs on how to do that:

Let us know if that doesn’t help and we’ll keep investigating :slight_smile:

1 Like

Hi Jen, thanks for the reply. This is exactly what I did a couple of days ago and yes this was the issue. I should have updated this post. Thanks again.

1 Like