Reputation: 4139
I'm creating an app using electron
and nodejs
, when I try to build it with electron-builder
using following command:
electron-builder --mac --linux --win --x64
it builds native modules only for my current os. Is there a way to build native modules for all operating systems?
Upvotes: 2
Views: 2019
Reputation: 3
You can look at https://www.npmjs.com/package/@centrid/native-modules-prebuilds-creator (homepage: https://github.com/centridsol/native-module-prebuilds-creator) . It allows you to create multiple prebuilds for your native node dependencies and then use those prebuilds whilst building your electron app
Upvotes: 0
Reputation: 4651
you can't. https://www.electron.build/multi-platform-build
If your app has native dependency,
it can be compiled only on the target platform unless prebuild is not used.
prebuild is a solution, but most node modules don't provide prebuilt binaries.
macOS Code Signing works only on macOS. Cannot be fixed.
Upvotes: 6