Dependencies installation error

3:37:28 PM: ────────────────────────────────────────────────────────────────
3:37:28 PM: Dependencies installation error
3:37:28 PM: ────────────────────────────────────────────────────────────────
3:37:28 PM: ​
3:37:28 PM: Error message
3:37:28 PM: Error while installing dependencies in /opt/build/repo/.netlify/plugins/
3:37:28 PM: npm WARN peerDependencies The peer dependency @gatsbyjs/reach-router@^1.3.6 included from @netlify/plugin-gatsby will no
3:37:28 PM: npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
3:37:28 PM: npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
3:37:28 PM: npm WARN peerDependencies The peer dependency common-tags@^1.8.2 included from @netlify/plugin-gatsby will no
3:37:28 PM: npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
3:37:28 PM: npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
3:37:28 PM: npm WARN peerDependencies The peer dependency execa@^5.0.0 included from @netlify/plugin-gatsby will no
3:37:28 PM: npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
3:37:28 PM: npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
3:37:28 PM: npm WARN peerDependencies The peer dependency encoding@^0.1.0 included from node-fetch will no
3:37:28 PM: npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
3:37:28 PM: npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
3:37:28 PM: npm WARN peerDependencies The peer dependency bufferutil@^4.0.1 included from ws will no
3:37:28 PM: npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
3:37:28 PM: npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
3:37:28 PM: npm WARN peerDependencies The peer dependency utf-8-validate@^5.0.2 included from ws will no
3:37:28 PM: npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
3:37:28 PM: npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
3:37:28 PM: npm WARN optional dep failed, continuing fsevents@2.3.2
3:37:28 PM: ​
3:37:28 PM: > node-addon-api@4.3.0 install /opt/build/repo/.netlify/plugins/node_modules/@netlify/plugin-gatsby/node_modules/@netlify/ipx/node_modules/ipx/node_modules/sharp/node_modules/node-addon-api
3:37:28 PM: > node-gyp rebuild
3:37:28 PM: ​
3:37:28 PM: (node:2307) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.
3:37:28 PM: (Use node --trace-deprecation ... to show where the warning was created)
3:37:28 PM: gyp: binding.gyp not found (cwd: /opt/build/repo/.netlify/plugins/node_modules/@netlify/plugin-gatsby/node_modules/@netlify/ipx/node_modules/ipx/node_modules/sharp/node_modules/node-addon-api) while trying to load binding.gyp
3:37:28 PM: gyp ERR! configure error
3:37:28 PM: gyp ERR! stack Error: gyp failed with exit code: 1
3:37:28 PM: gyp ERR! stack at ChildProcess.onCpExit (/opt/build/repo/node_modules/npm/node_modules/node-gyp/lib/configure.js:336:16)
3:37:28 PM: gyp ERR! stack at ChildProcess.emit (node:events:520:28)
3:37:28 PM: gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
3:37:28 PM: gyp ERR! System Linux 5.4.149-73.259.amzn2.x86_64
3:37:28 PM: gyp ERR! command “/opt/buildhome/.nvm/versions/node/v16.14.0/bin/node” “/opt/build/repo/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js” “rebuild”
3:37:28 PM: gyp ERR! cwd /opt/build/repo/.netlify/plugins/node_modules/@netlify/plugin-gatsby/node_modules/@netlify/ipx/node_modules/ipx/node_modules/sharp/node_modules/node-addon-api
3:37:28 PM: gyp ERR! node -v v16.14.0
3:37:28 PM: gyp ERR! node-gyp -v v3.6.0
3:37:28 PM: gyp ERR! not ok
3:37:28 PM: ​
3:37:28 PM: > bufferutil@4.0.6 install /opt/build/repo/.netlify/plugins/node_modules/@netlify/plugin-gatsby/node_modules/@netlify/ipx/node_modules/unstorage/node_modules/bufferutil
3:37:28 PM: > node-gyp-build
3:37:28 PM: ​​
3:37:28 PM: > utf-8-validate@5.0.8 install /opt/build/repo/.netlify/plugins/node_modules/@netlify/plugin-gatsby/node_modules/@netlify/ipx/node_modules/unstorage/node_modules/utf-8-validate
3:37:28 PM: > node-gyp-build
3:37:28 PM: ​
3:37:28 PM: npm ERR! Linux 5.4.149-73.259.amzn2.x86_64
3:37:28 PM: npm ERR! argv “/opt/buildhome/.nvm/versions/node/v16.14.0/bin/node” “/opt/build/repo/node_modules/.bin/npm” “install” “–no-progress” “–no-audit” “–no-fund” “–save-exact” “@netlify/plugin-gatsby@2.1.2”
3:37:28 PM: npm ERR! node v16.14.0
3:37:28 PM: npm ERR! npm v2.15.12
3:37:28 PM: npm ERR! code ELIFECYCLE
3:37:28 PM: ​
3:37:28 PM: npm ERR! node-addon-api@4.3.0 install: node-gyp rebuild
3:37:28 PM: npm ERR! Exit status 1
3:37:28 PM: npm ERR!
3:37:28 PM: npm ERR! Failed at the node-addon-api@4.3.0 install script ‘node-gyp rebuild’.
3:37:28 PM: npm ERR! This is most likely a problem with the node-addon-api package,
3:37:28 PM: npm ERR! not with npm itself.
3:37:28 PM: npm ERR! Tell the author that this fails on your system:
3:37:31 PM: Creating deploy upload records
3:37:28 PM: npm ERR! node-gyp rebuild
3:37:28 PM: npm ERR! You can get information on how to open an issue for this project with:
3:37:28 PM: npm ERR! npm bugs node-addon-api
3:37:28 PM: npm ERR! Or if that isn’t available, you can get their info via:
npm ERR!
3:37:28 PM: npm ERR! npm owner ls node-addon-api
3:37:28 PM: npm ERR! There is likely additional logging output above.
3:37:28 PM: ​
3:37:28 PM: npm ERR! Please include the following file with any support request:
3:37:28 PM: ​
3:37:28 PM: Resolved config
3:37:28 PM: build:
3:37:28 PM: command: npm run build
3:37:28 PM: commandOrigin: ui
3:37:28 PM: publish: /opt/build/repo/public
3:37:28 PM: publishOrigin: ui
3:37:32 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2 (Search results for '"non-zero exit code: 2"' - Netlify Support Forums)
3:37:28 PM: plugins:
3:37:28 PM: - inputs: {}
3:37:28 PM: origin: ui
3:37:28 PM: package: ‘@netlify/plugin-gatsby’
3:37:28 PM: Caching artifacts
3:37:28 PM: Started saving node modules
3:37:28 PM: Finished saving node modules
3:37:28 PM: Started saving build plugins
3:37:28 PM: Finished saving build plugins
3:37:28 PM: Started saving pip cache
3:37:28 PM: Finished saving pip cache
3:37:28 PM: Started saving emacs cask dependencies
3:37:28 PM: Finished saving emacs cask dependencies
3:37:28 PM: Started saving maven dependencies
3:37:28 PM: Finished saving maven dependencies
3:37:28 PM: Started saving boot dependencies
3:37:29 PM: Finished saving boot dependencies
3:37:29 PM: Started saving rust rustup cache
3:37:29 PM: Finished saving rust rustup cache
3:37:29 PM: Started saving go dependencies
3:37:29 PM: Finished saving go dependencies
3:37:31 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
3:37:31 PM: Failing build: Failed to build site
3:37:32 PM: Finished processing build request in 1m48.982158053s

Hiya, sorry you are having trouble with your build.

This Support Guide contains a ton of useful debugging tips that can likely help you solve your problem :slight_smile: Additionally, this Support Guide houses all of our resources for debugging build and deploy issues.

We also recommend trying to search the forums with the build error you encountered - it’s likely your question was already asked by someone else!

If you are still having problems, we will need further information in order to help you. Please provide as much information as you can on what you have already tried, your site URL, what your build settings are, your package.json or .toml file, etc. Thanks!