github electron/packager v19.0.0

2 days ago

19.0.0 (2025-10-15)

Electron Packager 19 introduces many breaking changes in an effort to modernize the codebase.

BREAKING CHANGES

Node.js 22

This package now requires Node.js >=22.12.0.

ESM

This package is now ESM-only.

Note

CommonJS projects can still consume this module via the require(esm) feature added to Node 22.

asar is enabled by default

By default, the asar option is now set to unpack native node modules.

const opts = {
  asar: {
    unpack: '**/{.**,**}/**/*.node'
  }
}

Note

This is equivalent to the behaviour out of the box with any Electron Forge v7 template.

Note

In Electron Packager 19, this is also equivalent to asar: true.

derefSymlinks is enabled by default

This was incorrectly documented in most previous versions of Electron Packager. See #1818.

Hooks are promisified and take in a single object argument

Electron Packager's various lifecycle hooks have changed their shape in two ways:

  • Hook arguments are now properties on a single JavaScript object rather than individual positional args.
  • The done callback arg was removed in favour of making hooks asynchronous.

For a trivial example:

// Electron Packager 18
const opts = {
  afterExtract: [
    (buildPath, electronVersion, platform, arch, callback) => {
      setTimeout(() => {
        console.log({ buildPath, electronVersion, platform, arch });
        callback();
      }, 1000);
    },
  ],
};

// Electron Packager 19
const opts = {
  afterExtract: [
    async ({ buildPath, electronVersion, platform, arch }) => {
      await new Promise((resolve) => {
        setTimeout(() => {
          console.log({ buildPath, electronVersion, platform, arch });
          resolve();
        }, 1000);
      });
    },
  ],
};

What's Changed

Full Changelog: v18.4.4...v19.0.0

Don't miss a new packager release

NewReleases is sending notifications on new releases.