pkg-fetch is a utility to fetch or build patched Node.js binaries used by the pkg tool to generate executables. The package v3.5.2 ships TypeScript types and provides prebuilt binaries for a wide range of Node versions (8, 10, 12, 14, 16, 18) across platforms (alpine, linux, linuxstatic, macos, win) and architectures (x64, arm64, armv7). It is maintained by Vercel and is a critical dependency for pkg users. Release cadence aligns with pkg updates and Node.js binary availability. Key differentiators: transparent GitHub Actions builds, hardcoded source hashes for supply chain security, and broad platform/architecture support.
npm install pkg-fetchNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates fetching a Node 18 binary for Linux x64, using the default export with async/await.
Upgrade to Node.js 14+ for continued support.
Ensure your macOS version is 11.0 or later, and that binaries are signed (Apple's Gatekeeper).
Do not rely on linuxstatic armv7 for production; use linux armv7 if available.
Set the PKG_CACHE_PATH environment variable to a writable directory or run with sudo.
Check internet connection, firewall, or use a proxy by setting the HTTPS_PROXY environment variable.
Use a different Node version that supports win32-arm64 (e.g., Node 14, 16, or 18) or switch architecture.