You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
building for macOS-arm64 but attempting to link with file built for macOS-x86_64
When I execute the following command:
npx node-pre-gyp configure --target_arch="x64"
You can see that the log output is still used arm64.
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using node-pre-gyp@1.0.9
node-pre-gyp info using node@18.9.1 | darwin | arm64
gyp info it worked if it ends with ok
gyp info using node-gyp@9.1.0
gyp info using node@18.9.1 | darwin | arm64
gyp info find Python using Python version 3.10.6 found at "/opt/homebrew/opt/python@3.10/bin/python3.10"
gyp info spawn /opt/homebrew/opt/python@3.10/bin/python3.10
gyp info spawn args [
gyp info spawn args '/opt/homebrew/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
Then it fails when I build:
npx node-pre-gyp build --target_arch=x64
CC(target) Release/obj.target/nothing/node_modules/node-addon-api/nothing.o
LIBTOOL-STATIC Release/nothing.a
warning: /Library/Developer/CommandLineTools/usr/bin/libtool: archive library: Release/nothing.a the table of contents is empty (no object file members in the library define global symbols)
SOLINK_MODULE(target) Release/Pulsar.node
ld: archive has no table of contents file '../pkg/lib/libpulsarwithdeps.a' for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Release/Pulsar.node] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/opt/homebrew/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:201:23)
gyp ERR! stack at ChildProcess.emit (node:events:513:28)
gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:291:12)
gyp ERR! System Darwin 21.6.0
Activity
shibd commentedon Oct 21, 2022
../pkg/lib/libpulsarwithdeps.ais have, it is x86_64 static library that I compiled through it.This is my
binding.gypconfiguration:binding.gyp
[-]The '--target_arch=' parameter does not work[/-][+]The '--target_arch' parameter does not work[/+]cclauss commentedon Apr 14, 2024
For support of Node.js > v17, see the workaround: