-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Problems with native modules #39
Comments
@timbod7 Hmm that's interesting. I haven't had this problem yet. So according to your assumption running Can we confirm that, maybe using |
Yes. I can confirm that running
|
Cool - glad we found at least a temporary solution. I'm really interested in digging a bit more into this problem - might take some time, but I'd love to solve this for future cases. :) Can not promise it happens quickly. So you're okay with nvm setup for now? Any help researching and debugging here is also more than welcome. |
Yes - happy with the nvm solution for now. Thanks for your help on this. |
Anytime. :) |
Please use two-package.json layout to avoid electron-rebuild usage. In 2.8 we support native dependencies compilation, see not yet commited docs. More detailed docs will be soon. |
@develar Could you please explain why the two package.json structure is ideal and how it enables support for native modules? I'm currently trying to require a native module and it throws errors about "bindings not found". |
@ccnokes It is a common practice, please see https://github.com/szwacz/electron-boilerplate#omg-but-seriously-why-there-are-two-packagejson In our readme there is a link to real world project. And yes, we (at least, I) are not going to fight against 2 mentioned critical issues — just use two package.json structure because otherwise it will be constant battle. |
@develar Thanks, I got it working! |
@ccnokes What did you do to make it work ? I'm having this issue : My version of node : v4.4.0 I'm trying to make an installer in Mac OSX yosemite for Windows. I run this command : npm run dist (based on this link : https://github.com/loopline-systems/electron-builder Thanks in advance |
@akdiallo nvm here only as an example tool to install custom version of nodejs. Nothing more. Just use two-package.json project structure and forget about native modules problem. electron-builder will rebuild native modules under the hood and you don't need to worry about it. |
@akdiallo ditto to what @develar said. But just in case you need more context, nvm stands for node version manager and simply allows you to run multiple version of node on the same machine, see https://github.com/creationix/nvm. |
@ccnokes @develar Thank you for your quick answer. That's what I'm doing and now i'm getting errors with makensis. When I run this command : electron-builder dist/win32/app-win32-x64/ --platform=win --out=dist/ --config=packager.json I have these errors :
|
Finally found where the problem was coming from . My .ico file wasn't good. It was 48x48 size when it should have been 256x256 . Moreover, I didn't put all of my resources in the build folder as specified in the electron-builder github page. |
@develar Why/How does your project not have an index.html file? Are you generating the HTML in JS and/or using iframe for the app content? Thanks |
@granteagon Web site (onshape.com) is loaded using BrowserWindow. |
Enjoy. Version 8 will be released soon. You are not forced to use two package.json structure anymore. |
@develar Thanks a ton man ❤️ . |
Similar problem here. |
My workflow for an electron app is
The last step is failing with the following error:
I believe this is happening because the electron-builder script is running using a node implementation incompatible with electron (which is why the electron-rebuild script is necessary):
Is this a bug? What is the recommended way to build build distributions with native modules?
The text was updated successfully, but these errors were encountered: