Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

package 'vips' requires 'libhwy >= 1.0.5' but version of libhwy is 1.0.4 #3948

Closed
DaveFlashNL opened this issue Jan 14, 2024 · 4 comments
Closed

Comments

@DaveFlashNL
Copy link

this is my error log

npm ERR! code 1
npm ERR! path /Users/David/Documents/Visual Studio Code/redacted/project/name/node_modules/sharp
npm ERR! command failed
npm ERR! command sh -c (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
npm ERR! TOUCH Release/obj.target/libvips-cpp.stamp
npm ERR!   CC(target) Release/obj.target/nothing/node_modules/node-addon-api/nothing.o
npm ERR!   LIBTOOL-STATIC Release/nothing.a
npm ERR!   CXX(target) Release/obj.target/sharp/src/common.o
npm ERR! info sharp Detected globally-installed libvips v8.15.1
npm ERR! info sharp Building from source via node-gyp
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | darwin | arm64
npm ERR! gyp info find Python using Python version 3.11.7 found at "/opt/homebrew/opt/[email protected]/bin/python3.11"
npm ERR! gyp info spawn /opt/homebrew/opt/[email protected]/bin/python3.11
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args '/opt/homebrew/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args 'binding.gyp',
npm ERR! gyp info spawn args '-f',
npm ERR! gyp info spawn args 'make',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/Users/David/Documents/Visual Studio Code/redacted/project/name/node_modules/sharp/build/config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/opt/homebrew/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/Users/David/Library/Caches/node-gyp/21.5.0/include/node/common.gypi',
npm ERR! gyp info spawn args '-Dlibrary=shared_library',
npm ERR! gyp info spawn args '-Dvisibility=default',
npm ERR! gyp info spawn args '-Dnode_root_dir=/Users/David/Library/Caches/node-gyp/21.5.0',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=/opt/homebrew/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=/Users/David/Library/Caches/node-gyp/21.5.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=/Users/David/Documents/Visual Studio Code/redacted/project/name/node_modules/sharp',
npm ERR! gyp info spawn args '-Dnode_engine=v8',
npm ERR! gyp info spawn args '--depth=.',
npm ERR! gyp info spawn args '--no-parallel',
npm ERR! gyp info spawn args '--generator-output',
npm ERR! gyp info spawn args 'build',
npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! Package 'vips' requires 'libhwy >= 1.0.5' but version of libhwy is 1.0.4
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: archive library: Release/nothing.a the table of contents is empty (no object file members in the library define global symbols)
npm ERR! ../src/common.cc:24:10: fatal error: 'vips/vips8' file not found
npm ERR! #include <vips/vips8>
npm ERR!          ^~~~~~~~~~~~
npm ERR! 1 error generated.
npm ERR! make: *** [Release/obj.target/sharp/src/common.o] Error 1
npm ERR! gyp ERR! build error 
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack at ChildProcess.<anonymous> (/opt/homebrew/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:209:23)
npm ERR! gyp ERR! System Darwin 22.6.0
npm ERR! gyp ERR! command "/opt/homebrew/Cellar/node/21.5.0/bin/node" "/opt/homebrew/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /Users/David/Documents/Visual Studio Code/redacted/project/name/node_modules/sharp
npm ERR! gyp ERR! node -v v21.5.0
npm ERR! gyp ERR! node-gyp -v v10.0.1
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in: /Users/David/.npm/_logs/2024-01-14T12_46_51_838Z-debug-0.log

i'm trying to build a react typescript appleication with node and electron, but it fails on the libvips sharp thing

@lovell lovell transferred this issue from lovell/sharp-libvips Jan 15, 2024
@lovell
Copy link
Owner

lovell commented Jan 15, 2024

It looks like you're using an old version of sharp that did not provide prebuilt binaries for the ARM64 macOS platform so are instead relying on a globally-installed libvips.

npm ERR! Package 'vips' requires 'libhwy >= 1.0.5' but version of libhwy is 1.0.4

This suggests libvips was not installed from the standard Homebrew core, as that does not provide a package of the name libhwy (instead naming it highway). Ignoring the name mismatch there is also currently no direct dependency between vips and highway, which instead is via a transitive dependency on jpeg-xl.

https://github.com/Homebrew/homebrew-core/blob/master/Formula/v/vips.rb

https://github.com/Homebrew/homebrew-core/blob/master/Formula/h/highway.rb

You'll probably need to do one of the following:

  • Work out where vips and libhwy are being installed from (a custom tap?) and ensure the latest versions are made available.
  • Remove vips and libhwy and re-install vips from Homebrew core.
  • Remove vips and libhwy and upgrade to the latest, supported version of sharp so it uses prebuilt binaries.

Please can you also head to where you cross-posted this at libvips/libvips#3816 and thank John for his time trying to help you.

@DaveFlashNL
Copy link
Author

DaveFlashNL commented Jan 15, 2024

I've discovered it's even more baffling than that, the highway version installed is already 1.0.7

@DaveFlashNL

This comment was marked as off-topic.

@DaveFlashNL
Copy link
Author

i've got additional proof it may be a macOS issue, see hidden comment for more info, as on a clean macOS Monterey VM on the same host mac, these issues do not appear and I'm able to build my projects using the latest updates to node, highway, brew and node_module dependencies for the given project along with electron and electron universal builder for apple.

Other than that, I had a minor issue with the sharp module installed during building inside of the numjs node module, but that issue is mitigated with the fix shared here.

@lovell lovell closed this as completed Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants