-
-
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
How to use single package.json structure #601
Comments
Do not specify
Please provide more details or sample project. Maybe related: https://github.com/electron-userland/electron-builder/wiki/Loading-App-Dependencies-Manually |
It would be great to have some more info on using just a single package.json file |
@fabiantheblind You can see project https://github.com/nodejs/installer It is single package.json file project. |
Thank you @develar |
@develar I did it exactly like this but I'm running into an issue with that:
looks like the same issue as #600 |
@fabiantheblind Yes, it is #600 |
@develar thanks. I renamed my app folder and now run into errors of mismatching native modules
So the solution is to just use 2 package.json files instead I guess. #39 (comment) |
@fabiantheblind If you have native modules — yes, you should use 2 package.json structure. |
Last question: For quick testing before restructuring my project with 2 package.json. How to find out which node version electron uses so I can use nvm to make a test on my machine? |
You don't need. Your unpacked electron app uses the same version of node as packed. So, just use electron-prebuilt or unpacked app. |
hm. I'm using electron-prebuilt already. Anyway thanks a lot for the quick help. I will switch to 2 package.json files |
@fabianmoronzirfas @develar did it work with single package.json? |
@akashnimare What do you mean? |
@akashnimare I work with 2 package.json anything else makes my head hurt |
@fabianmoronzirfas haha. I have only one json file in my app. Could you tell me what changes I need to do to make it work (app structure wise etc) ? |
Check out this project. https://github.com/frntl/frontal Actually you only need to have a package.json in the root of your project and another in your app folder. The one in the app folder or holds all of the dependencies. The one in the root of your project hold your development dependencies. |
@akashnimare "to make it work" is not clear. Please file new issue and describe — doesn't build (error?) or doesn't run after build (error?). Sorry, but my free time is limited and it is not wise to investigate if no clear error description. |
@develar Sorry if I was not clear. I'm currently trying as @fabianmoronzirfas suggested and will let you know if I have any issue. Thanks for the help. |
Same problem. I thought maybe I could set:
Though getting error that results as such
I tried reading through the codebase to understand how electron-builder assembles the asar file and how it uses these build options but there was so much abstraction I couldn't tell what was going on. The docs suggest you can do a single package.json build though no example
I used to have two package json structure though one of my devs changed it to one. I figured there was some way to configure exactly what would get packed into the asar though the configuration options don't appear very robust. This was suggested to have a single package file as an example |
@omenking What file is specified as |
if you mean what is set to |
The docs describe how to use the two package.json structure. However, when following this structure, I came across
dlopen
issues. How can I use a single package.json structure?In my package.json, I have the following:
Upon package, however, I get an error saying that my
main.js
file cannot be found.The text was updated successfully, but these errors were encountered: