forge icon indicating copy to clipboard operation
forge copied to clipboard

Forge fails to package on Node.js 24.16 and 26

Open long76 opened this issue 6 months ago • 17 comments

Pre-flight checklist

  • [x] I have read the contribution documentation for this project.
  • [x] I agree to follow the code of conduct 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

Kubuntu 24.04

Last known working Forge version

No response

Expected behavior

package success and out folder not empty

Actual behavior

forever package and out folder empty

Image

Steps to reproduce

  1. clone https://github.com/long76/build_bug
  2. install nodejs 24.16.0
  3. npm install
  4. npm run dist

Additional information

on 24.15.0 all ok

long76 avatar May 27 '26 17:05 long76

See https://github.com/electron/electron/issues/51619, extract-zip > yauzl@2 is broken on Node 24.16. Setting a manual resolution/override for [email protected] via your package manager will fix it.

In the meantime, we're planning on replacing extract-zip with a new internal lib to avoid this issue going forward.

Thank you for the report!

erickzhao avatar May 27 '26 18:05 erickzhao

See electron/electron#51619, extract-zip > yauzl@2 is broken on Node 24.16. Setting a manual resolution/override for [email protected] via your package manager will fix it.

In the meantime, we're planning on replacing extract-zip with a new internal lib to avoid this issue going forward.

Thank you for the report!

i see, thanks!

long76 avatar May 27 '26 18:05 long76

been using this at work for a few weeks. handles edge cases that caught us off guard with other tools. really well thought out.

Huaian666 avatar Jun 06 '26 05:06 Huaian666

Anyone else running into this issue, this is a extract-zip issue where you'll notice it only extracts the first file in the electron zip.

electron themselves are moving to a drop in replacement called electron-internal/extract-zip

Electron discussion and fix: https://github.com/electron/electron/issues/51963#issuecomment-4687717433

Electron packager themselves has also updated, and should be fixed with the current version https://github.com/electron/packager/pull/1917#issuecomment-4626940591

This should be fixed once electron packager is updated internally for forge. For people currently experiencing this problem, resolve or override the package resolution

For my pnpm setup, I simply redirected extract-zip to the electron internal version that already comes with the rest of the electron ecosystem

// pnpm-workspace.yaml
overrides: 
  extract-zip: npm:@electron-internal/[email protected]

Hope this helps someone!

mkmakes avatar Jun 12 '26 22:06 mkmakes

For anyone using yarn as their package manager, the fix is to add

  "resolutions": {
    "extract-zip": "npm:@electron-internal/[email protected]"
  }

to your package.json

bloomkd46 avatar Jun 15 '26 23:06 bloomkd46

@erickzhao fix will be in forge 8?

long76 avatar Jul 01 '26 08:07 long76

Thanks for the comment @long76, we had fixed it and I queued up a release but it didn't publish before I went on PTO. It's out now: https://github.com/electron/forge/releases/tag/v8.0.0-alpha.10

erickzhao avatar Jul 06 '26 15:07 erickzhao

Thanks for the comment @long76, we had fixed it and I queued up a release but it didn't publish before I went on PTO. It's out now: https://github.com/electron/forge/releases/tag/v8.0.0-alpha.10

Thanks!

long76 avatar Jul 06 '26 17:07 long76

re-run Steps to reproduce on NodeJS 24.18.0, seems all works Image

see: https://github.com/nodejs/node/issues/63487#issuecomment-4798713628

long76 avatar Jul 23 '26 12:07 long76

Yep, thanks for the update @long76. The Node team intentionally reverted the change to avoid breaking users, iirc?

erickzhao avatar Jul 23 '26 15:07 erickzhao

The Node team intentionally reverted the change to avoid breaking users, iirc?

seems like that, but replace yauzl@2 needed for support newer versions nodejs

long76 avatar Jul 23 '26 15:07 long76

I'm experiencing the same issue on Node.js v26.7.0, but it works fine on v25.9.0.

ronggang avatar Sep 18 '26 01:09 ronggang

The same on Windows. Tried node v26.9.0 to package my project, no luck. Switched back to node v24.21.0 and all things work again.

create3000 avatar Sep 21 '26 15:09 create3000

@ronggang @create3000 try

npm i @electron-forge/[email protected]

long76 avatar Sep 21 '26 16:09 long76

I'm prepping the first Forge v8 stable release for this week. Stay tuned!

erickzhao avatar Sep 21 '26 18:09 erickzhao

8.0.1 was released, all works for me. feel free to reopen

long76 avatar Oct 12 '26 14:10 long76

8.0.1 was released, all works for me. feel free to reopen

on node v26.13.0 works too

"devDependencies": {
    "@electron-forge/cli": "^8.0.1"
}

long76 avatar Nov 05 '26 13:11 long76