Throw an exception if native modules are being rebuilt and the host platform is not the target platform
See original GitHub issue- I have read the contribution documentation for this project.
- I agree to follow the code of conduct that this project follows, as appropriate.
- I have searched the issue tracker for an issue that matches the one I want to file, without success.
I am using windows server 2012 R2 X64 as the main develop server, when i am packing my project i get for windows X32/X64 everything are good, when i am create package for linux x32/x64 and i am trying to run it in linux ubuntu 16.04, i getting error from the node native module that i installed (work fine in windows), the module is “serialport”.
this is the error that i get when i am trying to run the project:
A JavaScript error occurred in the main process Uncaught Exception: Error: /home/pos/dp-linux-x64/resources/app/node_modules/serialport/build/Release/serialport.node: invalid ELF header at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:173:20) at Object.Module._extensions…node (module.js:598:18) at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:173:20) at Module.load (module.js:488:32) at tryModuleLoad (module.js:447:12) at Function.Module._load (module.js:439:3) at Module.require (module.js:498:17) at require (internal/module.js:20:19) at bindings (/home/pos/dp-linux-x64/resources/app/node_modules/bindings/bindings.js:81:44) at Object.<anonymous> (/home/pos/dp-linux-x64/resources/app/node_modules/serialport/lib/bindings/linux.js:2:36)
(dp:9425): GLib-GIO-CRITICAL **: g_dbus_connection_register_object: assertion ‘G_IS_DBUS_CONNECTION (connection)’ failed
(dp:9425): GLib-GIO-CRITICAL **: g_dbus_connection_register_object: assertion ‘G_IS_DBUS_CONNECTION (connection)’ failed
(dp:9425): GLib-GIO-CRITICAL **: g_dbus_connection_get_unique_name: assertion ‘G_IS_DBUS_CONNECTION (connection)’ failed
(dp:9425): GConf-WARNING **: Client failed to connect to the D-BUS daemon: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
after that i amd trying to rebuild the ,odule in ubuntu and replcae the folder in npm mudules, then i get that the version of node are diffrents:
(dp:9687): GLib-GIO-CRITICAL **: g_dbus_connection_register_object: assertion ‘G_IS_DBUS_CONNECTION (connection)’ failed
(dp:9687): GLib-GIO-CRITICAL **: g_dbus_connection_register_object: assertion ‘G_IS_DBUS_CONNECTION (connection)’ failed
(dp:9687): GLib-GIO-CRITICAL **: g_dbus_connection_get_unique_name: assertion ‘G_IS_DBUS_CONNECTION (connection)’ failed
START
A JavaScript error occurred in the main process
Uncaught Exception:
Error: The module ‘/home/pos/dp-linux-x64/resources/app/node_modules/serialport/build/Release/serialport.node’
was compiled against a different Node.js version using
NODE_MODULE_VERSION 46. This version of Node.js requires
NODE_MODULE_VERSION 54. Please try re-compiling or re-installing
the module (for instance, using npm rebuild
ornpm install
).
at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:173:20)
at Object.Module._extensions…node (module.js:598:18)
at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:173:20)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at bindings (/home/pos/dp-linux-x64/resources/app/node_modules/bindings/bindings.js:81:44)
at Object.<anonymous> (/home/pos/dp-linux-x64/resources/app/node_modules/serialport/lib/bindings/linux.js:2:36)
(dp:9687): GLib-GIO-CRITICAL **: g_dbus_connection_register_object: assertion ‘G_IS_DBUS_CONNECTION (connection)’ failed
(dp:9687): GLib-GIO-CRITICAL **: g_dbus_connection_register_object: assertion ‘G_IS_DBUS_CONNECTION (connection)’ failed
(dp:9687): GLib-GIO-CRITICAL **: g_dbus_connection_get_unique_name: assertion ‘G_IS_DBUS_CONNECTION (connection)’ failed
(dp:9687): GConf-WARNING **: Client failed to connect to the D-BUS daemon: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
Console output when you run electron-forge
with the environment variable DEBUG=electron-forge:*
. (Instructions on how to do so here). Please include the stack trace if one exists.
Put the console output here
What command line arguments are you passing?
Put the arguments here
What does your config.forge
data in package.json
look like?
"config": {
"forge": {
"make_targets": {
"win32": [
"squirrel"
],
"darwin": [
"zip"
],
"linux": [
"deb",
"rpm"
]
},
"electronPackagerConfig": {
"icon": "./DokoPoint.ico",
"packageManager": "npm",
"platform": "all",
"arch": "all"
},
"electronWinstallerConfig": {
"name": "dp"
},
"electronInstallerDebian": {},
"electronInstallerRedhat": {},
"github_repository": {
"owner": "",
"name": ""
},
"windowsStoreConfig": {
"packageName": "",
"name": "dp"
}
}
},
please help as soon as posible its very urgent for me, thanks 👍
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:12 (8 by maintainers)
Top GitHub Comments
Are you trying to build a package for a Linux target platform on a Windows host platform? If so, that won’t work because Node doesn’t have a concept of cross-compiling native modules.
@malept The easiest way to do this is to provide our own walker to
rebuild
and makerebuild
export the logic it uses to determine if aModule
is a native module or not 👍I’ll look at tackling that next week when I’m not on beach wifi 😆