electron / electron/forge

`electron-winstaller` marked as optionalDependency causes missing transitive dependencies in `maker-squirrel`

Open
#4,284 1 comment 2 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
7.1k
Forks
641
Avg merge
3d 1h
Merged PRs (30d)
30

Description

### Pre-flight checklist

- [x] I have read the [contribution documentation](https://github.com/electron/forge/blob/main/CONTRIBUTING.md) for this project.
- [x] I agree to follow the [code of conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md) that this project uses.
- [x] I have searched the issue tracker for a bug that matches the one I want to file, without success.

### Forge version

7.11.2

### Electron version

42.3.0

### Operating system

Win11 24H2

### Last known working Forge version

7.11.1

### Expected behavior

`electron-winstaller` should be installed with a complete and consistent dependency tree, regardless of package manager, so that:

- all required transitive dependencies are reliably resolved
- behavior is consistent across npm / `pnpm` / yarn
- CI builds are deterministic

### Actual behavior

Because `electron-winstaller` is an `optionalDependency`, its dependency resolution becomes unreliable in some package managers and environments.

### Steps to reproduce

Using pnpm:
```
pnpm add electron-forge @electron-forge/maker-squirrel
pnpm install
pnpm electron-forge make
```
In pnpm environments, this results in errors similar to:
```
Error: Cannot find module 'lodash'
```
missing transitive dependencies inside `electron-winstaller`.

### Additional information

`@electron-forge/maker-squirrel` depends on `electron-winstaller`, which is declared as an `optionalDependency`.
This leads to cases where `electron-winstaller` is installed, but its transitive dependencies are not reliably installed/resolved in certain package managers (notably pnpm), causing runtime or build failures.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.