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
Hyphens ('1.0.1-0') not a valid version string when building on @electron-forge/maker-squirrel #3533
I agree to follow the code of conduct that this project uses.
I have searched the issue tracker for a bug that matches the one I want to file, without success.
Electron Forge version
7.3.0
Electron version
v29.1.2
Operating system
Windows 11 23h2
Last known working Electron Forge version
n/a
Expected behavior
Build would be successful using hyphenated version numbers created by npm version prerelease
Actual behavior
An unhandled rejection has occurred inside Forge:
Error: Failed with exit code: 1
Output:
Attempting to build package from 'my_app.nuspec'.
'1.0.1-0' is not a valid version string.
Parameter name: version
at ChildProcess.<anonymous> (D:\dev\versionNumber\my-app\node_modules\electron-winstaller\lib\spawn-promise.js:48:24)
at ChildProcess.emit (node:events:514:28)
at ChildProcess.emit (node:domain:488:12)
at maybeClose (node:internal/child_process:1105:16)
at ChildProcess._handle.onexit (node:internal/child_process:305:5)
Steps to reproduce
Open a folder
npm init electron-app@latest my-app
cd my-app
npm version prerelease
✅ Observe the version is now 1.0.0-0
npm run make
❌ Observe you get an unhandled exception
This only seems to affect @electron-forge/maker-squirrel . I can build just fine on macOS using @electron-forge/maker-zip
An unhandled rejection has occurred inside Forge:
Error: Failed with exit code: 1
Output:
Attempting to build package from 'my_app.nuspec'.
'1.0.1-0' is not a valid version string.
Parameter name: version
at ChildProcess.<anonymous> (D:\dev\versionNumber\my-app\node_modules\electron-winstaller\lib\spawn-promise.js:48:24)
at ChildProcess.emit (node:events:514:28)
at ChildProcess.emit (node:domain:488:12)
at maybeClose (node:internal/child_process:1105:16)
at ChildProcess._handle.onexit (node:internal/child_process:305:5)
Sadly, no. Luckily the app we're using is for internal use only. So can do most of the testing on macOS, and when it's ready for use, we just promote the alpha as a patch (npm run patch) and build from that.
Activity
stdavis commentedon Oct 17, 2024
@gabriel-cloud Did you ever find a solution to this? We are experiencing the same issue with our app.
gabriel-cloud commentedon Oct 18, 2024
Sadly, no. Luckily the app we're using is for internal use only. So can do most of the testing on macOS, and when it's ready for use, we just promote the alpha as a patch (
npm run patch) and build from that.erickzhao commentedon Jan 31, 2025
Hi, this is an upstream limitation for Windows apps, as they expect
v.x.y.zformat.We generally just take the 3-digit Windows apps and append a fourth
0digit to it.forge/packages/maker/base/src/Maker.ts
Lines 176 to 180 in 64d54e8
However, I see the Squirrel.Windows maker doesn't use that util so maybe this is an enhancement to make.