Failed during stage “install dependencies” with no errors

Hi,

I forked a GitHub repo and tried to deploy it on Netlify, but I am getting an error when deploying the code via the website.
I got an error of

“Failed during stage ‘Install dependencies’: dependency_installation script returned non-zero exit code”

in the deployment page but on the detail page it says:

1:15:14 PM: [ERROR] Deploy logs are currently unavailable. We are working on resolving the issue.

I don’t know what to do.

This is the repo I am trying to deploy:
https://github.com/bchiang7/v4

@jalilimmd What’s the full build log?

There is no more log.
All it says is this.

@jalilimmd Fair enough.

I was hoping to help you decipher the log, but there’s not much anyone could do with that.

It seems you’ll need to wait until the log is working correctly or Netlify’s team assist.

Oh, that sounds not good
Thanks for your attention @nathanmartin

Ok, the logs are working now.
Can you help me with that ?
Here is the logs:

10:12:31 AM: > Successfully installed Yarn 1.22.19! Please open another terminal where the `yarn` command will now be available.
10:12:31 AM: No yarn workspaces detected
10:12:31 AM: Started restoring cached node modules
10:12:31 AM: Finished restoring cached node modules
10:12:31 AM: Installing npm packages using Yarn version 1.22.19
10:12:31 AM: yarn install v1.22.19
10:12:31 AM: [1/4] Resolving packages...
10:12:32 AM: [2/4] Fetching packages...
10:12:50 AM: [3/4] Linking dependencies...
10:12:50 AM: warning " > babel-preset-gatsby@1.4.0" has unmet peer dependency "core-js@^3.0.0".
10:12:50 AM: warning "gatsby > eslint-config-react-app@6.0.0" has unmet peer dependency "babel-eslint@^10.0.0".
10:12:50 AM: warning "gatsby > express-graphql@0.9.0" has incorrect peer dependency "graphql@^14.4.1".
10:12:50 AM: warning "gatsby > @typescript-eslint/eslint-plugin > tsutils@3.21.0" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
10:12:50 AM: warning "gatsby > eslint-plugin-graphql > graphql-config > @endemolshinegroup/cosmiconfig-typescript-loader > ts-node@9.1.1" has unmet peer dependency "typescript@>=2.7".
10:12:50 AM: warning "gatsby-plugin-netlify > webpack-assets-manifest@5.0.6" has unmet peer dependency "webpack@^5.2.0".
10:12:50 AM: warning " > styled-components@5.3.0" has unmet peer dependency "react-is@>= 16.8.0".
10:12:59 AM: [4/4] Building fresh packages...
10:13:04 AM: Failed during stage 'Install dependencies': dependency_installation script returned non-zero exit code: 1
10:13:04 AM: error /opt/build/repo/node_modules/sharp: Command failed.
10:13:04 AM: Exit code: 1
10:13:04 AM: Command: (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
10:13:04 AM: Arguments:
10:13:04 AM: Directory: /opt/build/repo/node_modules/sharp
10:13:04 AM: Output:
10:13:04 AM: sharp: Detected globally-installed libvips v8.15.1
10:13:04 AM: sharp: Building from source via node-gyp
10:13:04 AM: gyp info it worked if it ends with ok
10:13:04 AM: gyp info using node-gyp@5.1.0
10:13:04 AM: gyp info using node@14.16.0 | linux | x64
10:13:04 AM: gyp info find Python using Python version 3.13.1 found at "/opt/buildhome/.local/share/mise/installs/python/3.13.1/bin/python"
10:13:04 AM: gyp http GET https://nodejs.org/download/release/v14.16.0/node-v14.16.0-headers.tar.gz
10:13:04 AM: gyp http 200 https://nodejs.org/download/release/v14.16.0/node-v14.16.0-headers.tar.gz
10:13:04 AM: gyp http GET https://nodejs.org/download/release/v14.16.0/SHASUMS256.txt
10:13:04 AM: gyp http 200 https://nodejs.org/download/release/v14.16.0/SHASUMS256.txt
10:13:04 AM: gyp info spawn /opt/buildhome/.local/share/mise/installs/python/3.13.1/bin/python
10:13:04 AM: gyp info spawn args [
10:13:04 AM: gyp info spawn args   '/opt/buildhome/.nvm/versions/node/v14.16.0/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
10:13:04 AM: gyp info spawn args   'binding.gyp',
10:13:04 AM: gyp info spawn args   '-f',
10:13:04 AM: gyp info spawn args   'make',
10:13:04 AM: gyp info spawn args   '-I',
10:13:04 AM: gyp info spawn args   '/opt/build/repo/node_modules/sharp/build/config.gypi',
10:13:04 AM: gyp info spawn args   '-I',
10:13:04 AM: gyp info spawn args   '/opt/buildhome/.nvm/versions/node/v14.16.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
10:13:04 AM: gyp info spawn args   '-I',
10:13:04 AM: gyp info spawn args   '/opt/buildhome/.cache/node-gyp/14.16.0/include/node/common.gypi',
10:13:04 AM: gyp info spawn args   '-Dlibrary=shared_library',
10:13:04 AM: gyp info spawn args   '-Dvisibility=default',
10:13:04 AM: gyp info spawn args   '-Dnode_root_dir=/opt/buildhome/.cache/node-gyp/14.16.0',
10:13:04 AM: gyp info spawn args   '-Dnode_gyp_dir=/opt/buildhome/.nvm/versions/node/v14.16.0/lib/node_modules/npm/node_modules/node-gyp',
10:13:04 AM: gyp info spawn args   '-Dnode_lib_file=/opt/buildhome/.cache/node-gyp/14.16.0/<(target_arch)/node.lib',
10:13:04 AM: gyp info spawn args   '-Dmodule_root_dir=/opt/build/repo/node_modules/sharp',
10:13:04 AM: gyp info spawn args   '-Dnode_engine=v8',
10:13:04 AM: gyp info spawn args   '--depth=.',
10:13:04 AM: gyp info spawn args   '--no-parallel',
10:13:04 AM: gyp info spawn args   '--generator-output',
10:13:04 AM: gyp info spawn args   'build',
10:13:04 AM: gyp info spawn args   '-Goutput_dir=.'
10:13:04 AM: gyp info spawn args ]
10:13:04 AM: Traceback (most recent call last):
10:13:04 AM:   File "/opt/buildhome/.nvm/versions/node/v14.16.0/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 50, in <module>
10:13:04 AM:     sys.exit(gyp.script_main())
10:13:04 AM:              ~~~~~~~~~~~~~~~^^
10:13:04 AM:   File "/opt/buildhome/.nvm/versions/node/v14.16.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 554, in script_main
10:13:04 AM:     return main(sys.argv[1:])
10:13:04 AM:   File "/opt/buildhome/.nvm/versions/node/v14.16.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 547, in main
10:13:04 AM:     return gyp_main(args)
10:13:04 AM:   File "/opt/buildhome/.nvm/versions/node/v14.16.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 520, in gyp_main
10:13:04 AM:     [generator, flat_list, targets, data] = Load(
10:13:04 AM:                                             ~~~~^
10:13:04 AM:         build_files, format, cmdline_default_variables, includes, options.depth,
10:13:04 AM:         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
10:13:04 AM:         params, options.check, options.circular_check,
10:13:04 AM:         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
10:13:04 AM:         options.duplicate_basename_check)
10:13:04 AM:         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
10:13:04 AM:   File "/opt/buildhome/.nvm/versions/node/v14.16.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 136, in Load
10:13:04 AM:     result = gyp.input.Load(build_files, default_variables, includes[:],
10:13:04 AM:                             depth, generator_input_info, check, circular_check,
10:13:04 AM:                             duplicate_basename_check,
10:13:04 AM:                             params['parallel'], params['root_targets'])
10:13:04 AM:   File "/opt/buildhome/.nvm/versions/node/v14.16.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 2782, in Load
10:13:04 AM:     LoadTargetBuildFile(build_file, data, aux_data,
10:13:04 AM:     ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
10:13:04 AM:                         variables, includes, depth, check, True)
10:13:04 AM:                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
10:13:04 AM:   File "/opt/buildhome/.nvm/versions/node/v14.16.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 391, in LoadTargetBuildFile
10:13:04 AM:     build_file_data = LoadOneBuildFile(build_file_path, data, aux_data,
10:13:04 AM:                                        includes, True, check)
10:13:04 AM:   File "/opt/buildhome/.nvm/versions/node/v14.16.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 234, in LoadOneBuildFile
10:13:04 AM:     build_file_contents = open(build_file_path, 'rU').read()
10:13:04 AM:                           ~~~~^^^^^^^^^^^^^^^^^^^^^^^
10:13:04 AM: ValueError: invalid mode: 'rU' while trying to load binding.gyp
10:13:04 AM: gyp ERR! configure error
10:13:04 AM: gyp ERR! stack Error: `gyp` failed with exit code: 1
10:13:04 AM: gyp ERR! stack     at ChildProcess.onCpExit (/opt/buildhome/.nvm/versions/node/v14.16.0/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
10:13:04 AM: gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
10:13:04 AM: gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
10:13:04 AM: gyp ERR! System Linux 5.10.228-219.884.amzn2.x86_64
10:13:04 AM: gyp ERR! command "/opt/buildhome/.nvm/versions/node/v14.16.0/bin/node" "/opt/buildhome/.nvm/versions/node/v14.16.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
10:13:04 AM: gyp ERR! cwd /opt/build/repo/node_modules/sharp
10:13:04 AM: gyp ERR! node -v v14.16.0
10:13:04 AM: gyp ERR! node-gyp -v v5.1.0
10:13:04 AM: gyp ERR! not ok
10:13:04 AM: info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
10:13:04 AM: Error during Yarn install
10:13:04 AM: Failing build: Failed to install dependencies

@jalilimmd It’s failing while trying to build and install sharp.

It’s possible it’s a useless suggestion, but you could try downgrading the Netlify build image, I’ve seen some people experiencing issues with Sharp find that doing so worked for them, (with the caveat that their issues weren’t identical to yours).

See:
https://docs.netlify.com/configure-builds/overview/#build-image-selection

Outside of that I’ve got nothing to offer, as I don’t work with any of this tooling.

1 Like

Thank you for the help. @nathanmartin

This issue was resolved by removing yarn.lock file in the project and add --force env for the npm install command in the site configuration.

But now I have a build issue that I created another issue here.

@jalilimmd Great work, thanks for updating with the solution, hopefully it helps others!

1 Like