-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Nested node_modules disappears after building #3185
Comments
Same issue here for me.
When I build, there is no
But if I downgrade to 20.15.0, it works fine. |
Interesting, I'll need to give this a try, thanks for the note. |
It did indeed package |
In version 20.16 the way node_modules includes work was changed: explicit includes are now ignored, instead all production dependencies are used. Unfortunately, excludes are still allowed to affect the node_modules folders and that means your !node_modules takes effect. Looking at your example above:
The first line will prevent inclusion of anything in the Remove the exclusion for node_modules and newer versions than 20.15 should work fine. In fact, you should be able to remove all lines mentioning the node_modules folder. (Edit: tried to explain in more detail.) |
@hn3000 There's a condition that when use |
Then maybe a second package.json can help? https://www.electron.build/tutorials/two-package-structure |
And a change like this was made in a minor update (20.15 -> 20.16)? Intentionally? |
Am I missing something here? How is this bug still not addressed? My project depends on semver@^5.6.0 |
My application brings together 9 independent submodules (which have a life of their own in in other apps) and each has their own node_module. I've been using a much earlier version of electron-builder (19.55.3) for over a year without any issues -- all the node_modules were copied into my installer. After upgrading to the latest version, I've lost 3 days of development trying to understand this issue. It really need to be address. Seconding what TanninOne said, without fixing this issue, electron-builder is unusable. |
Is there any update regarding this issue? Or any workaround? I've spent 2 days fiddling with various setting and nothing is working. I can't proceed to release an installer at this rate. Anyone have any suggestions? |
Doesn't it work if you fix the version?
…On Mon, Jun 10, 2019, 11:06 PM Charles ***@***.***> wrote:
Is there any update regarding this issue? Or any workaround? I've spent 2
days fiddling with various setting and nothing is working. I can't proceed
to release an installer at this rate. Anyone have any suggestions?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#3185?email_source=notifications&email_token=ABS4AU2KOM6CAIW3NILP74TPZ4JCBA5CNFSM4FMURQ42YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXLZX5I#issuecomment-500669429>,
or mute the thread
</~https://github.com/notifications/unsubscribe-auth/ABS4AU2J2QFT3QYNZSANNKDPZ4JCBANCNFSM4FMURQ4Q>
.
|
I tried that but when I rolled back to 20.15.0 I got a new error:
So I'm sticking with the latest version. I've edited the electron-builder code for now and removed the node_modules filter but that's probably the wrong thing to do. Do you know why electron-builder is removing node_modules? I tried looking at the code but the commenting is very sparse and I can't figure it out. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Has this been fixed? If not, it's definitely something that should be addressed, it's a big headache. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Not fixed yet |
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
I've updated my comment and included a patch that we will now use to work around this issue. |
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Yes |
This issue still continues and no one is taking any action on it. |
@karlsnyder0 if your patch is working and not breaking other stuff maybe you could submit a PR for it anyways to get more attention to a possible fix for this pretty nasty issue? Just a thought. PS. Thanks for the patch code (I hadn't heard about patch-package, what a sweet npm package) |
@karlsnyder0 I take back what I said. It doesn't appear your patch is working. I had to modify it slightly so it didn't break immediately: patches/app-builder-lib+22.9.1.patch
In your version I was getting a
Any help from the maintainers on this issue would be appreciated. Thanks! |
I hit this issue and was forced to figure something out because of needing to update electron and electron-builder. It has some issues, but works well enough for us. |
Is this error related?
|
This is still a frustrating issue today. |
It is well known that the "node_modules" folder cannot be renamed, so it is extremely frustrating that electron-builder makes such an opinionated decision by removing all nested node_modules folders from the app. You would think that there would be some flexibility with this option in particular, but no, everyone is forced to restructure their app or use an outdated version of electron-builder or use ugly patches. I do not understand how this is not a top priority issue. |
Does anyone have a repro gist or repo that I could try locally? Something like electron-quick-start @bedney, happy to review it |
So it's been a while since I looked at this issue for my own purposes. I was able to workaround this by setting Is this an accurate characterization of this problem? I'd like to help fix this, but if folks could confirm for me that this is the problem that they're seeing, we can go from there. Thanks! |
Exactly.
Also correct. This wouldn't be an issue if we could just add |
@mmaietta I just put together a minimal example: /~https://github.com/somebeaver/electron-builder-issue-3185 The readme has all the info needed. It's basically just the default Please let me know if there's any issues with the repo. |
It's been a while since I concerned myself with this issue but this wasn't exactly what I experienced.
This means that in unfortunate cases the application might run but crash due to missing api or be exposed to security issues that were supposedly fixed. |
@TanninOne - thanks for the report, but I don't think that's what's going on here. I've tracked down the code where this bug is happening and it is coded to specifically omit nested I have a patch in hand that I'm testing that seems to do what folks here want and I'm going to test it a bit more this morning before issuing the PR. |
All, @somebeaver, @mmaietta - My PR is located here: #5911. First of all, thanks @somebeaver for putting together the excellent test case. I used it a lot when testing this. So, this patch requires some explanation because it's my best attempt to solve a less-than-ideal situation. Currently, due to #1539, all So that is part of what this patch does. I have introduced a new flag, Now, given @somebeaver's use case, I wanted to take it a bit further. There may be cases when you want to not include all submodules
So that's it. Now, here's the thing about this patch: I am not a TypeScript programmer (been a JavaScripter forever), so I had to struggle a bit with some of the tricks I had to do to make TypeScript cooperate. I needed access to Also, it also looks like I'm getting a couple of test failures. So I could use some help to fix this patch (@mmaietta or others). Lastly, the That's all. I'm hoping we can push this forward and get it into the codebase. Cheers,
|
A new version of this patch has been pushed and I'm actively working with the project maintainers to resolve any outstanding issues. |
Further status update: I now have a patch that passes all of the tests (and I added a few tests to test this new capability). As soon as the maintainers pull this in, we should be good to go :-). |
All - Thanks to @mmaietta this patch is now in the codebase trunk! Hopefully this fixes this longstanding issue. The patch implements the functionality as detailed in #3185 (comment). If you find other issues with including submodules Cheers!
|
Unfortunately, this caused this nasty bug to appear: #6045 |
Similar to #1539, I'm working with an app where I've cloned another git repo int and I have several
node_modules
folders. When I build, thenode_modules
folder in the nested git repo disappears. This happens whether asar is enabled or disabled. It also happens regardless of whether or not the inner git repo is officially designated as a git submodule or if I've just manually cloned it in.Here's my folder structure:
Here's a Stack Overflow issue I just created that may explain it better (I didn't want to copy/paste but let me know if that's preferred) and here's the repo I'm working with.
It's also worth noting that I've tried building this for Windows and my friend said it works fine on there. I haven't tested that recently though so I can't give much info on that immediately. I also haven't inspected the Resources contents of the packaged app (or whatever the .exe counterpart would be) so I can't provide info on that but I do know that when I look in the mac app's Resources directory there is no
node_modules
folder within the nested git repo.The text was updated successfully, but these errors were encountered: