Migration from vercel/pkg
vercel/pkg was archived in January 2024 and no longer receives updates. yao-pkg/pkg is the actively maintained fork and the recommended path forward.
For the vast majority of projects, migration is a one-line dependency rename — nothing else changes.
TL;DR
npm uninstall pkg
npm install --save-dev @yao-pkg/pkgpnpm remove pkg
pnpm add -D @yao-pkg/pkgyarn remove pkg
yarn add -D @yao-pkg/pkgUpdate any package.json scripts that called the bin:
{
"scripts": {
- "build": "pkg ."
+ "build": "pkg ."
},
"devDependencies": {
- "pkg": "^5.8.1",
+ "@yao-pkg/pkg": "^6.15.0"
}
}The CLI name (pkg) is unchanged — only the npm package name differs. All existing pkg ., pkg index.js, pkg -t ... commands keep working.
What's different
Node.js version support
| Fork | Supported Node.js versions |
|---|---|
vercel/pkg | 12, 14, 16, 18 |
yao-pkg/pkg | 22, 24 (Node >= 22 required on the build host) |
yao-pkg/pkg drops the older EOL Node.js versions and keeps pace with upstream LTS. If you were packaging node18-... binaries with vercel/pkg, you'll need to update your targets to node22-... or node24-....
New features beyond vercel/pkg
- SEA mode — stock Node.js packaging via the official Single Executable Applications API. No patched Node.js.
- Enhanced SEA — full dependency walker + VFS on top of SEA. ESM with top-level await works everywhere. See SEA vs Standard.
- Improved ESM — most ESM features work transparently now, no manual transform needed. See ESM support.
- Active bug fixes — regular releases, responsive issue triage, up-to-date base binaries via
pkg-fetch. - Workers + native addons work in both standard and SEA modes.
Breaking changes from vercel/pkg@5.x
For 99% of projects, none. The CLI, package.json config schema, and API are source-compatible.
If you hit a corner case:
- Dropped Node.js 12 / 14 / 16 / 18 targets — update to
node22ornode24. - The
public/public-packagessemantics are unchanged, but--no-bytecodenow requires explicit--public-packagesif your deps have non-SPDX licenses. This was already the case invercel/pkg, but the enforcement is stricter. - A few internal APIs under
lib/have been refactored. If you were importing deep paths instead of the documented{ exec }entry point, you may need to adjust. See API for the stable surface.
Verify the migration
pkg --version # should print a 6.x version
pkg . # or your existing commandIf the build succeeds and the output runs the same as before, you're done.
Running into trouble?
- CLI hangs on first run. That's
pkg-fetchdownloading a fresh base binary on the first build for the new fork. Let it finish; subsequent builds hit the cache. - Error about missing target. Check your target against
pkg-fetchreleases — older Node.js versions may no longer be built. - Anything else. Open an issue on yao-pkg/pkg with a reproduction; maintainers actively triage.
See also
- Getting started
- SEA vs Standard — the biggest new feature since
vercel/pkg - pkg-fetch — where the base binaries come from
