You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Move @electron/rebuild into optionalDependencies #4134
I agree to follow the code of conduct that this project uses.
I have searched the issue tracker for a feature request that matches the one I want to file, without success.
Problem description
Many firms disallow installation of node-gyp. This module is dragged in through @electron/rebuild, thus preventing @electron/forge from being installed without hacky workarounds.
I believe this problem can be solved by moving @electron/rebuild into optionalDependencies. Only a small percentage of electron projects require native module building, and those projects almost by definition won't have restrictions on node-gyp. Anyone else will be able to install the library without getting stuck at this point.
Proposed solution
Move @electron/rebuild into optionalDependencies.
Alternatives considered
To get around this problem, we've been using a resolution that points node-gyp to a fake library. But this requires some manual hand-holding with our customers.
Additional information
No response
Reacted by Theo Yan, Kiril Popov, Svyatoslav, toni-ppet, Diego Alzate, mxraw and Andrew Chou
Similar to what @thorsent has mentioned here, npm v12 disables git dependencies by default, which means installation errors will start surfacing if forge doesn't update @electron/rebuild
Activity
thorsent commentedon Apr 20, 2026
This may start to affect more people because Yarn 4 apparently has increased security around git downloads during install.
We are currently working around these issues with an override that essentially replaces @electron/node-gyp with an empty package.
achou11 commentedon Jul 20, 2026
Similar to what @thorsent has mentioned here, npm v12 disables git dependencies by default, which means installation errors will start surfacing if forge doesn't update
@electron/rebuildchore: update deps (#638)
chore: update deps (#638)