-
-
Notifications
You must be signed in to change notification settings - Fork 402
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
Incorrect prebuilt binary selected on build #861
Comments
Same error for me too. Using MACBOOK PRO M1 - MAC OS 12 (VSCODE IDE) "devDependencies": { Error: dlopen(/Users//ionic/electron//node_modules/better-sqlite3-with-prebuilds/build/Release/better_sqlite3.node, 0x0001): tried: '/Users//ionic/electron//node_modules/better-sqlite3-with-prebuilds/build/Release/better_sqlite3.node' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')) |
请问目前这个问题,有人有解法么? |
Also getting this on an M1 MacBook running Monterey Error: node:internal/modules/cjs/loader:1243
return process.dlopen(module, path.toNamespacedPath(filename));
^
Error: dlopen(/Users/<REDACTED>/node_modules/better-sqlite3/build/Release/better_sqlite3.node, 0x0001): tried: '/Users/<REDACTED>/node_modules/better-sqlite3/build/Release/better_sqlite3.node' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e'))
Noticed that it was not erring with Node Relevant in the changelog:
I use n for managing my Node.js versions and I noticed this in their documentation:
So I decided to try both the $ n rm 16.0.0
$ n --arch arm64 16.0.0
installing : node-v16.0.0
mkdir : /usr/local/n/versions/node/16.0.0
fetch : https://nodejs.org/dist/v16.0.0/node-v16.0.0-darwin-arm64.tar.xz
installed : v16.0.0
$ node index.js
# errors
$ n rm 16.0.0
$ n --arch x64 16.0.0
installing : node-v16.0.0
mkdir : /usr/local/n/versions/node/16.0.0
fetch : https://nodejs.org/dist/v16.0.0/node-v16.0.0-darwin-x64.tar.xz
installed : v16.0.0
$ node index.js
# does not error Based on this observed behavior, it seems there's a compatibility issue with the arm64 binaries. I see a lot of discussion about this going on over at #601, so maybe this is a duplicate. Though I'm not using Electron as I also see a recent related PR (#859) though that seems to be merged and present on
"node_modules/better-sqlite3": {
"version": "8.0.1",
"resolved": "https://registry.npmjs.org/better-sqlite3/-/better-sqlite3-8.0.1.tgz",
"integrity": "sha512-JhTZjpyapA1icCEjIZB4TSSgkGdFgpWZA2Wszg7Cf4JwJwKQmbvuNnJBeR+EYG/Z29OXvR4G//Rbg31BW/Z7Yg==",
"hasInstallScript": true,
"dependencies": {
"bindings": "^1.5.0",
"prebuild-install": "^7.1.0"
}
}, Note: I went ahead and installed |
I have an opposite issue:
I'm running macOS 13.1 (Apple M1), electron-forge 6.0.4, electron 22.0.2, better-sqlite3 8.0.1 |
Got this fixed by downgrading electron-forge from |
rebuild:npm rebuild --runtime=electron --arch=arm64 --target=22.3.2 --disturl=https://atom.io/download/atom-shell --abi=110 i use electron@22.3.2,my node modules is 110 |
I'm running in to an issue building, not sure if this better-sqlite3 related or another config. I'm getting:
Error: dlopen(/.../node_modules/better-sqlite3/build/Release/better_sqlite3.node, 0x0001): tried: '/.../node_modules/better-sqlite3/build/Release/better_sqlite3.node' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e'))
I'm running macOS 12 (m1 Mac), electron-forge, electron 19.0.10.
The text was updated successfully, but these errors were encountered: