I’m struggling to build my portfolio: evenguyen.netlify.app
I already set the build command to CI=‘’ npm run build, I updated all the packages (I think) so I’m not sure what’s the problem. The error messages aren’t any help either
10:39:36 PM: npm ERR! | ^
10:39:36 PM: npm ERR! /opt/buildhome/.node-gyp/16.17.0/include/node/node.h:893:3: note: in expansion of macro ‘NODE_MODULE_X’
10:39:36 PM: npm ERR! 893 | NODE_MODULE_X(modname, regfunc, NULL, 0) // NOLINT (readability/null_usage)
10:39:36 PM: npm ERR! | ^~~~~~~~~~~~~
10:39:36 PM: npm ERR! …/src/binding.cpp:358:1: note: in expansion of macro ‘NODE_MODULE’
10:39:36 PM: npm ERR! 358 | NODE_MODULE(binding, RegisterModule);
10:39:36 PM: npm ERR! | ^~~~~~~~~~~
10:39:36 PM: npm ERR! make: *** [binding.target.mk:133: Release/obj.target/binding/src/binding.o] Error 1
10:39:36 PM: npm ERR! gyp ERR! build error
10:39:36 PM: npm ERR! gyp ERR! stack Error: make failed with exit code: 2
10:39:36 PM: npm ERR! gyp ERR! stack at ChildProcess.onExit (/opt/build/repo/node_modules/node-gyp/lib/build.js:262:23)
10:39:36 PM: npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:513:28)
10:39:36 PM: npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
10:39:36 PM: npm ERR! gyp ERR! System Linux 5.4.196-108.356.amzn2.x86_64
10:39:36 PM: npm ERR! gyp ERR! command “/opt/buildhome/.nvm/versions/node/v16.17.0/bin/node” “/opt/build/repo/node_modules/node-gyp/bin/node-gyp.js” “rebuild” “–verbose” “–libsass_ext=” “–libsass_cflags=” “–libsass_ldflags=” “–libsass_library=”
10:39:36 PM: npm ERR! gyp ERR! cwd /opt/build/repo/node_modules/node-sass
10:39:36 PM: npm ERR! gyp ERR! node -v v16.17.0
10:39:36 PM: npm ERR! gyp ERR! node-gyp -v v3.8.0
10:39:36 PM: npm ERR! gyp ERR! not ok
10:39:36 PM: npm ERR! Build failed with error code: 1
10:39:36 PM: npm ERR! A complete log of this run can be found in:
10:39:36 PM: npm ERR! /opt/buildhome/.npm/_logs/2022-09-03T05_37_01_447Z-debug-0.log
10:39:36 PM: Error during NPM install
10:39:36 PM: Build was terminated: Build script returned non-zero exit code: 1
10:39:36 PM: Creating deploy upload reds
10:39:36 PM: Failing build: Failed to build site
10:39:36 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 1 (Search results for '"non-zero exit code: 1"' - Netlify Support Forums)
10:39:36 PM: Finished processing build request in 2m42.215455381s
The Netlify plugin requires gatsby 4 as per this message:
Your package.json has "gatsby": "^2.23.7" but there is also mention of version 2.32.12
Given you are using gatsby v2 (which is about 2 years old) I suspect it doesn’t like NodeJS v16. You could try adding the --force or --legacy-peer-deps using NPM_FLAGS environment variable, downgrading NodeJS to v14 using the NODE_VERSION environment variable, or updating gatsby (and everything else in the project) to the latest versions. Check out npm outdated.