-
-
Notifications
You must be signed in to change notification settings - Fork 393
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
Failed to build in Electron #704
Comments
I ran into a similar problem when upgrading to Electron 15. The problem seems to be that
I got it working by rebuilding from source manually:
But I wonder if there is a way to make |
Something doesn't add up to me. I go home, tried rebuilding from the source manually and it works. Then I go to office, do the same, thinking it will work but guess what? I got the same error. I'm scratching my hair right now. |
@kryops experienced 100% the same as you, manually building works, but it's tedious if
Basically it means that
Since node-abi is basically only used as a reference table, I'm fine with "overwriting" to the newest version, there are not breaking "feature" changes, it just houses the latest abi numbers for node versions. I opened an issue at electron/rebuild#886 since it's an issue on their end, I think we can close the issue here. |
@tom2strobl thanks so much for your analysis, I can confirm that the |
@tom2strobl Thanks, resolution fix working for us now too, along with a cloned version of |
Linking #694 |
This should be fixed in |
I'm not sure this is fixed in
With better-sqlite at v7.4.4, repeatedly ran
Also related, nowhere on https://nodejs.org/en/download/releases/ does it list a version of NodeJS that has a NODE_MODULE_VERSION of 98. Am I missing something? |
See my comment above, 98 is an abi version, which you can find in this list: https://github.com/nodejs/node/blob/master/doc/abi_version_registry.json |
Ah, that's confusing. I managed to get this to sorta build by running |
@zkldi If you're using electron-builder, I'd recommend using a
|
This issue is also happening to me still in 7.4.4? What did I do wrong? |
I don't get it, how are we supposed to fix this? I've added
to my
|
@electrovir did you find a solution to this? |
@Lermatroid Nope 😕 |
Hello. Although I haven't had this problem in recent releases, the "buildDependenciesFromSource" option always worked for me. Cheers. |
I have "postinstall": "electron-builder install-app-deps" set and I added the I kept getting "was compiled against a different Node.js version using" error. Solution below If you are getting this error:
I believe the wrong node headers are being downloaded. As an example I'm trying to build for Electron 16, so need NODE_MODULE_VERSION 99. However instead the standard headers (not the Electron ones) for Node version 16..0..0 are being downloaded (NODE_MODULE_VERSION 93) when I run the following command for better-sqlite3 build-release --target=16.0.0 --arch=x64 --dist-url=https://electronjs.org/headers after which you will see that the wrong node distribution is being downloaded, look carefully at the output here and you will see that it is retrieved from:
And you will see if you go to your node-gyp cache This is the node that better-sqliite3 was built against, and it's wrong. Now delete this directory, in my case: To get the correct Electron "node" I used this build command:
I have no idea why the first build script failed yet the second worked (taken from here https://www.electronjs.org/docs/latest/tutorial/using-native-node-modules) When looking at the better-sqlite3 package.json the command And I'm not sure why the electron builder "postinstall": "electron-builder install-app-deps" isn't doing the right thing. Anyway if you got this far at least you'll understand WHERE the NODE_MODULE_VERSION is set to 93 and WHY and how to manually fix it. |
Can anybody help me use this in Electron?
I tried the following command,
but every time I start running the application, I got an error of
The text was updated successfully, but these errors were encountered: