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

it show "mach-o, but wrong architecture " when try to run demos/button.js 【macOs M1 arm64】 #9

Open
fanzhiri opened this issue Sep 20, 2021 · 1 comment

Comments

@fanzhiri
Copy link

我先修改了awtk/awtk_config.py中TARGET_ARCH

if is32bit:
if MACH == 'i686' or MACH == 'i386' or MACH == 'x86':
TARGET_ARCH='x86'
else:
TARGET_ARCH='arm'
else:
TARGET_ARCH='' 这一句改为如下
TARGET_ARCH='arm64'

编译好awtk再去编译awtk-nodejs
然后想运行demo,就看到如下错误了

fanzhiri@fanzhirideAir awtk-nodejs % node demos/button.js
/Users/fanzhiri/GitHub/awtk-nodejs/node_modules/bindings/bindings.js:121
throw e;
^
Error: dlopen(/Users/fanzhiri/GitHub/awtk-nodejs/build/Release/awtk.node, 1): no suitable image found. Did find:
/Users/fanzhiri/GitHub/awtk-nodejs/build/Release/awtk.node: mach-o, but wrong architecture
/Users/fanzhiri/GitHub/awtk-nodejs/build/Release/awtk.node: mach-o, but wrong architecture
at Object.Module._extensions..node (internal/modules/cjs/loader.js:1122:18)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at bindings (/Users/fanzhiri/GitHub/awtk-nodejs/node_modules/bindings/bindings.js:112:48)
at Object. (/Users/fanzhiri/GitHub/awtk-nodejs/awtk.js:1:31)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)

@fanzhiri
Copy link
Author

fanzhiri@fanzhirideAir awtk-nodejs % node demos/button.js
binding.js bindings opts:awtk.node
binding.js bindings opts.module_root:/Users/fanzhiri/GitHub/awtk-nodejs
binding.js bindings exports.getFileName():/Users/fanzhiri/GitHub/awtk-nodejs/awtk.js
binding.js bindings path.extname(opts.bindings):.node
binding.js opts.path :undefined
binding.js opts.path :undefined
binding.js opts.path :undefined
/Users/fanzhiri/GitHub/awtk-nodejs/node_modules/bindings/bindings.js:127
throw e;
^

Error: dlopen(/Users/fanzhiri/GitHub/awtk-nodejs/build/Release/awtk.node, 0x0001): tried: '/Users/fanzhiri/GitHub/awtk-nodejs/build/Release/awtk.node' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/usr/local/lib/awtk.node' (no such file), '/usr/lib/awtk.node' (no such file)
at Object.Module._extensions..node (internal/modules/cjs/loader.js:1122:18)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at bindings (/Users/fanzhiri/GitHub/awtk-nodejs/node_modules/bindings/bindings.js:117:48)
at Object. (/Users/fanzhiri/GitHub/awtk-nodejs/awtk.js:1:31)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant