-
-
Notifications
You must be signed in to change notification settings - Fork 513
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
Throw an exception if native modules are being rebuilt and the host platform is not the target platform #380
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. |
Also, specifying |
yes but when i run electron-forge package --arch=ia32 --platform=linux its make me package for linux system, so its dont work? |
Rebuilding the native module won't work if your target platform is not the same as the host platform. You'll need to use a Linux VM to build Linux distributables (and a macOS machine, if you choose to create a darwin/mas target). I'm surprised it doesn't throw an exception when it gets to the rebuild stage. @MarshallOfSound it would be cool if we could detect inside Forge if we need to rebuild a native module, and |
so what version of linux do you suggest to install and build? because i tried what you say on ubuntu 16.04 and electron-forge dont worked currectlly. |
Ubuntu 16.04 works fine (that is what our tests use). I would suggest that instead of installing Forge globally, you add |
this is the error that i get when i am trying to install the electron-forge in linux: oh oh Error: EACCES: permission denied, stat '/root/.bashrc' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: appdmg@^0.4.5 (node_modules/electron-forge/node_modules/electron-installer-dmg/node_modules/appdmg): npm ERR! electron-forge@4.1.5 install: npm ERR! Please include the following file with any support request: |
As I mentioned in my previous comment, install Forge locally in your project, not globally. |
ok i installed as you say but now the system dont reconize the electron-forge command.. so how i can run electron-forge init test? |
I assumed you were trying to build your existing project instead of creating a new project. Workarounds are described #321 (comment) and #321 (comment). |
Fixing the bug "Throw an exception if native modules are being rebuilt and the host platform is not the target platform" is turning out to be more complicated than I'd like, because I can't say "stop the rebuild promise when it hits the criteria". I think what's going to happen is that we'll need to walk the node_modules tree once (in an |
@malept The easiest way to do this is to provide our own walker to I'll look at tackling that next week when I'm not on beach wifi 😆 |
This PR adds a Contributing section to the README and descriptive text for running Fiddle from source in CONTRIBUTING.md.
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. (/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. (/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 variableDEBUG=electron-forge:*
. (Instructions on how to do so here). Please include the stack trace if one exists.What command line arguments are you passing?
What does your
config.forge
data inpackage.json
look like?please help as soon as posible its very urgent for me, thanks 👍
The text was updated successfully, but these errors were encountered: