Skip to content

maker-zip fails on Windows with Node.js 25+: cross-zip calls fs.rmdir with the removed recursive option #4459

Open

Description

@svierk

Pre-flight checklist

  • I have read the contribution documentation for this project.
  • 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.

Forge version

8.0.1

Electron version

44.9.1

Operating system

Windows (GitHub Actions windows-latest), Node.js 26.13.0

Last known working Forge version

None - 8.0.1 works on Node.js 24; the failure comes with Node.js 25+, not with a Forge release.

Expected behavior

electron-forge make with @electron-forge/maker-zip creates the zip distributable on Windows, as it does on Node.js 24 and on macOS/Linux with Node.js 26.

Actual behavior

The zip maker fails on Windows with Node.js 25 or later:

❯ Making a zip distributable for win32/x64
TypeError [ERR_INVALID_ARG_VALUE]: The property 'options.recursive' is no longer supported. Received true
    at Object.rmdir (node:fs:1499:11)
    at doZip (D:\a\ogs-planer-app\ogs-planer-app\node_modules\cross-zip\index.js:49:10)
    at D:\a\ogs-planer-app\ogs-planer-app\node_modules\cross-zip\index.js:22:9
    at FSReqCallback.oncomplete (node:fs:197:5)

maker-zip zips through cross-zip, which on win32 calls fs.rmdir(outPath, { recursive: true, maxRetries: 3 }) (index.js#L49). Node.js 25 removed the recursive option of fs.rmdir (DEP0147), so the call now throws. Node.js 26 is the current LTS line, and @electron-forge/maker-zip declares "node": ">= 22.13.0", so every Windows user who moves to the LTS hits this.

Steps to reproduce

  1. On Windows, use Node.js 25 or 26.
  2. npx create-electron-app@latest repro && cd repro
  3. In forge.config.js, enable the zip maker for Windows: platforms: ['darwin', 'win32'] (the template limits it to darwin).
  4. npm run make

The zip step fails with the error above. Public CI run that shows it: https://github.com/svierk/ogs-planer-app/actions/runs/41301240683/job/124832929156 (the macOS and Linux jobs of the same run pass).

Additional information

The bug is in cross-zip, but it cannot be fixed there in practice: the package has had no release since February 2024 (4.0.1 is the latest), the report feross/cross-zip#38 is open since 2024, and the fix feross/cross-zip#40 (fs.rm instead of fs.rmdir) has been waiting for review since August 2026.

Possible ways forward for Forge:

  • replace cross-zip in maker-zip with a maintained zip implementation, or
  • bring the small zip helper into Forge (the Windows branch only needs fs.rm(outPath, { recursive: true, force: true, maxRetries: 3 })).

Happy to open a pull request for whichever direction you prefer.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions