Go to file
github-actions[bot] f6ed5bfbda
fix: update expected shas (#136)
Update expected sha256sums for Node.js

3e7ddc77635f6225b8cba469b948752d16decdb94293b13ea6c9ce4792526d2e
node-v20.19.6-alpine-arm64
39f3a1fb1c83ecd3483e4335124bd9282dba239fcdf85430b7aea8fbfb8a1206
node-v20.19.6-alpine-x64
3f19fd984a558d2b3cc2f78fae2a3927b9d87a631ad454eeccf7ffd10e7c6f19
node-v20.19.6-linux-arm64
de270a8b37db68307fead80ddb75718c5599d4a96004d052588e24fac0a5e8f5
node-v20.19.6-linux-x64
049aefa14949d95ded5e3761b263171b1a5d430c1b6af10ab82ffbdfd945507a
node-v20.19.6-linuxstatic-arm64
96b66e0cb1bc3f53e4e652e4a1b4d1c51acec13d2c9136c7cb0f565d75ba60f5
node-v20.19.6-linuxstatic-armv7
ddc9c76e002e6e1768139099d27bf297bf564750187cef230e3113f773a97724
node-v20.19.6-linuxstatic-x64
4f50f1d0484cc69043abacd266de603773dc84a2d5ae0233453c701fed0d2241
node-v20.19.6-macos-arm64
9ed57a94c5dfc099fc262884b633fad61a7fba19b4b43ca2fd7a2ec0ffa5580d
node-v20.19.6-macos-x64
a0384fe007e78340cc863224dafd5a6de5c97b83ea8c764e1f31abfeaea07d03
node-v20.19.6-win-arm64
3203fce16436a5e78f77e927c2d1616404d567e20fd11d9f21cb41aa524978a7
node-v20.19.6-win-x64
7795a8932f8dfdebc3636cf83bfa69b7da2e4256dbfa99fe39a4c201a95d70f8
node-v24.12.0-alpine-arm64
d157149a911313dda8ceb6bc93096d531a850b0e6c1b76b2ac721e4f49413ce9
node-v24.12.0-alpine-x64
9a5816b9e3552bb5a914aeed16326a569e18dcc17f07ad8dd28b4a7fa67066a4
node-v24.12.0-linux-arm64
81a0b40e6d7d14d501e100a5a1f08eb3621c2323ee66c6bfd42f7bf7407b06dc
node-v24.12.0-linux-x64
fdb80c730160db3157923e8fef52df595aba597757affb9f7c0e11c5562f4ccd
node-v24.12.0-linuxstatic-arm64
4f9f3c2a1e3155f4203f8043e04412e7be90dc16ac7f78341083f9f1076b138c
node-v24.12.0-linuxstatic-x64
9dffdd09697f041369fec623e86dc866f00a4daaa9da84808f7352372339d9de
node-v24.12.0-macos-arm64
a7e48452945f37a831f96ab49f52d5049b989c68137cd398553787d3d1b14554
node-v24.12.0-macos-x64
9db6863e384aa746d1ae369c38aa11f3e46550240bb0abcbedb27d2a085c669d
node-v24.12.0-win-arm64
78eda417c8baf713d1790b8b42d8e6eec846101bb4249776d68069d64d240570
node-v24.12.0-win-x64

Co-authored-by: robertsLando <robertsLando@users.noreply.github.com>
2025-12-11 17:26:22 +01:00
.github feat: add workflow_call inputs for expected sha256sums 2025-10-29 09:12:36 +01:00
.vscode chore: update vscode settings 2023-11-21 14:59:29 +01:00
lib fix: update expected shas (#136) 2025-12-11 17:26:22 +01:00
patches feat: add v24.12.0 patch (#135) 2025-12-11 10:02:09 +01:00
scripts refactor: replace chalk and fs-extra (#53) 2024-10-17 06:56:51 +00:00
.dockerignore Add workflows for Alpine binaries 2021-04-15 23:47:45 +08:00
.eslintignore forgot shebang to make cli work 2016-08-31 09:02:52 +03:00
.eslintrc pkg-fetch: migrate to TypeScript (#139) 2021-03-29 12:46:10 +08:00
.gitignore chore: remove shas.txt from ignore 2024-05-29 09:33:34 +02:00
.prettierignore Run prettier, convert to standard eslint, add CI (#138) 2021-03-26 16:51:31 -07:00
.release-it.json chore: switch to .release-it.json configuration (#119) 2025-10-07 16:31:45 +02:00
CHANGELOG.md Release 3.5.30 2025-10-29 15:53:47 +01:00
DEVELOPMENT.md fix: update expected sha of node 18.18.2 and 16.20.2 (#6) 2023-10-17 08:21:19 +02:00
Dockerfile.alpine feat: node 24 support and attempt some Node 22 fixes (by @faulpeltz) (#107) 2025-09-17 14:50:36 +02:00
Dockerfile.alpine-muslcc feat: node 24 support and attempt some Node 22 fixes (by @faulpeltz) (#107) 2025-09-17 14:50:36 +02:00
Dockerfile.linux feat: node 24 support and attempt some Node 22 fixes (by @faulpeltz) (#107) 2025-09-17 14:50:36 +02:00
Dockerfile.linuxcross build: use jammy to build linux.cross (#123) by @faulpeltz 2025-10-13 14:40:45 +02:00
license.md Create license.md 2017-06-22 10:39:28 +02:00
package.json Release 3.5.30 2025-10-29 15:53:47 +01:00
README.md docs: update list of built versions and glibc requirement (#58) 2024-10-25 09:37:11 +00:00
shas.txt fix: update expected shas (#136) 2025-12-11 17:26:22 +01:00
tsconfig.json Cleanup, remove unused dependencies (#154) 2021-04-06 16:34:39 +08:00
yarn.lock fix: bump tar-fs from 2.1.1 to 3.1.1 to fix security vulnerabilities (#117) 2025-10-02 17:23:46 +02:00

A utility to fetch or build patched Node binaries used by pkg to generate executables. This repo hosts prebuilt binaries in Releases.

Binary Compatibility

Node Platform Architectures Minimum OS version
81, 101, 121, 141, 161, 18, 20, 22 alpine x64, arm64 3.7.3, other distros with musl libc >= 1.1.18
81, 101, 121, 141, 161 linux x64 Enterprise Linux 7, Ubuntu 14.04, Debian jessie, other distros with glibc >= 2.17
18, 20, 22 linux x64 Enterprise Linux 8, Ubuntu 20.04, Debian buster, other distros with glibc >= 2.28
81, 101, 121, 141, 161 linux arm64 Enterprise Linux 8, Ubuntu 18.04, Debian buster, other distros with glibc >= 2.27
18, 20, 22 linux arm64 Enterprise Linux 9, Ubuntu 20.04, Debian bullseye, other distros with glibc >= 2.31
81, 101, 121, 141, 161, 18, 20, 22 linuxstatic x64, arm64 Any distro with Linux Kernel >= 2.6.32 (>= 3.10 strongly recommended)
161, 18, 20, 22 linuxstatic armv72 Any distro with Linux Kernel >= 2.6.32 (>= 3.10 strongly recommended)
81, 101, 121, 141, 161, 18, 20, 22 macos x64 10.13
141, 161, 18, 20, 22 macos arm643 11.0
81, 101, 121, 141, 161, 18, 20, 22 win x64 8.1
141, 161, 18, 20, 22 win arm64 10

[1]: end-of-life, may be removed in the next major release.

[2]: best-effort basis, not semver-protected.

[3]: mandatory code signing is enforced by Apple.

Security

We do not expect this project to have vulnerabilities of its own. Nonetheless, as this project distributes prebuilt Node.js binaries,

Node.js security vulnerabilities affect binaries distributed by this project, as well.

Like most of you, this project does not have access to advance/private disclosures of Node.js security vulnerabilities. We can only closely monitor the public security advisories from the Node.js team. It takes time to build and release a new set of binaries, once a new Node.js version has been released.

It is possible for this project to fall victim to a supply chain attack.

This project deploys multiple defense measures to ensure that the safe binaries are delivered to users:

  • Binaries are compiled by Github Actions
    • Workflows and build logs are transparent and auditable.
    • Artifacts are the source of truth. Even repository/organization administrators can't tamper them.
  • Hashes of binaries are hardcoded in source
    • Origins of the binaries are documented.
    • Changes to the binaries are logged by VCS (Git) and are publicly visible.
    • pkg-fetch rejects the binary if it does not match the hardcoded hash.
  • GPG-signed hashes are available in Releases
    • Easy to spot a compromise.
  • pkg-fetch package on npm is strictly permission-controlled
    • Only @robertsLando can push new revisions to npm.

Contributing Updates to Patches

Example workflow for applying patches to a new version of Node.js (18.13.0)

  1. Clone Node.js as a sibling to your current pkg-fetch clone

    • git clone -b v18.13.0 --single-branch https://github.com/nodejs/node.git
    • cd node
  2. Attempt to apply the closest patch (e.g. applying the existing patch for 18.12.1 when trying to generate a new patch for 18.13.0)

  • git apply ..\pkg-fetch\patches\node.v18.12.1.cpp.patch --reject
  1. If no rejects, great! you are ready to make your new patch file.
  • git add -A
  • git diff --staged --src-prefix=node/ --dst-prefix=node/ > ..\pkg-fetch\patches\node.v18.13.0.cpp.patch
  1. If rejects exist, resolve them yourself, and ensure all changes are saved, and repeat step 4 to export the patch file

Resolving Rejects

Usually when a patch is rejected, it's because the context around the changes was refactored slightly since the last patched version. This is not usually complicated to resolve, but requires a human to interpret the changes since the last version pkg was patched against, compared with the version you wish to create a patch for.

One method is to pull up the diff for the file where the rejects apply for the changes between the last tag (e.g. v18.12.1 to use the previous example) and the tag you want a patch for (e.g. v18.13.0 to use the previous example). Alongside this, have the .rej file and go through each rejected hunk by hunk and use your best judgement to determine how it should apply against the new tag.

Save you results, and export the overall git diff with the commands from the example above.

Checking that patches apply cleanly

The expectation is that a patch applies cleanly, with no delta or offsets from the source repo.

When making a change to a patch file, it is possible to apply that patch without building by running

yarn applyPatches --node-range node18

where the --node-range can be specified to apply patches for the version of node for which you are updating patches. If unspecified, the latest node version in patches.json will be used.

Ultimately, the patch should result in fully functional node binary, but the applyPatches script can be used to quickly iterate just the application of the patches you are updating without needing to wait for the full build to complete.

Building a Binary Locally

You can use the yarn start script to build the binary locally, which is helpful when updating patches to ensure functionality before pushing patch updates for review.

For example:

yarn start --node-range node18 --arch x64 --output dist

Small ICU

Node.js binaries built by this project use the small-icu option to reduce the size of the binary. If you need a Node.js binary with full ICU support, you can build it yourself by setting the --with-intl=full-icu option. Small ICU is sufficient for most use cases, and it reduces the binary size by about 30 MB.

Environment

Var Description
PKG_BUILD_PATH Directory to use to clone and build nodejs binaries. Default to system temporary directory
PKG_CACHE_PATH Path to pkg-cache. Default to ~/.pkg-cache
PKG_IGNORE_TAG Ignore tag folder when checking local binary path
PKG_NODE_PATH Custom path to the local nodejs binary to use
HTTPS_PROXY Optional HTTPS proxy to use when fetching binaries
HTTP_PROXY Optional HTTP proxy to use when fetching binaries
MAKE_JOB_COUNT Number of parallel jobs when building binaries (value passed to make -j option). Default to number of cpus
CFLAGS Flags to use when invoking C compiler
CXXFLAGS Flags to use when invoking C++ compiler
STRIP Path to strip command. Default to strip