Skip to the text
KDOS
Menu
kdos.dev KDOS from Scratch KDOS 0.2 · 4dd4a10 · 2026-11-30 Contents Index

62.3. nodejs-26.10.0

JavaScript runtime built on Chrome's V8 JavaScript engine

Version 26.10.0, release 1
Shelf lang — Language implementations, plus the modules of any language that has no module shelf of its own
Phase 31_compilers (Compilers), 17 of 22 in build order
Licence MIT AND BSD-3-Clause AND Artistic-2.0
Homepage https://nodejs.org/
Build time 70.1 SBU
Installed size 91.5 MiB in 2193 files
Recipe ports/core/lang/nodejs/kpkgbuild

About

Node.js is the JavaScript runtime built on V8, with npm. In KDOS it is a build tool more than a program anyone runs: the browsers (chromium, firefox-esr, librewolf), thunderbird and qt6-qtwebengine run JavaScript at build time, and yarn and cncjs run on it.

The KDOS build links Node against the system’s libraries wherever its configure offers a switch for it: c-ares, zlib, libuv, OpenSSL, zstd, libffi, brotli, nghttp2, SQLite and ICU each come from their own port, and the copies under deps/ in the tarball are not compiled. A security fix to one of those ports reaches Node when the library is rebuilt, without rebuilding Node.

Sources

Dependencies

Depends on: c-ares, icu, python3, libuv, zlib, openssl, zstd, libffi, brotli, nghttp2, sqlite, rust.

Required by (8): chromium, cncjs, firefox-esr, krohnkite, librewolf, qt6-qtwebengine, thunderbird, yarn.

Patches

build.sh applies these; kpkg applies nothing by itself.

Installation

From the repository root, inside the build container, this is the line kdosbuild runs for the port:

script/chroot/exec.sh bash -c 'source script/phases/31_compilers/phase.env && kpkg install nodejs'

What kpkg does

kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/lang/nodejs.

1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.

cd /ports/core/lang/nodejs
echo '7b3a546d33cb7e15a43bdd7a57e0be5d5fd5ffc553e6e4c120033e66f0ba20c5  nodejs-26.10.0.tar.xz' | sha256sum -c -

2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.

SRC_ROOT=/var/cache/kpkg/work/nodejs
SRC=$SRC_ROOT/nodejs-26.10.0
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf nodejs-26.10.0.tar.xz -C "$SRC" --strip-components=1

Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.

3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:

patch -p1 -i $PORT_SRC/v8-temporal-system-icu.patch
install -m644 "/usr/share/icu/$(pkg-config --modversion icu-uc)/zoneinfo64.res" \
	deps/crates/vendor/zoneinfo64-v0_3/src/data/zoneinfo64.res

export CFLAGS="${CFLAGS/-O2/-O3}" CXXFLAGS="${CXXFLAGS/-O2/-O3}"
./configure \
	--prefix=/usr \
	--shared-cares \
	--shared-zlib \
	--shared-libuv \
	--shared-openssl \
	--openssl-use-def-ca-store \
	--shared-zstd \
	--shared-ffi \
	--shared-brotli \
	--shared-nghttp2 \
	--shared-sqlite \
	--v8-enable-temporal-support \
	--with-intl=system-icu
make
make DESTDIR=$PKG install
for d in "$PKG"/usr/lib/node_modules/npm/man/man*; do
	install -Dm644 -t "$PKG/usr/share/man/${d##*/}" "$d"/*
done

The switches, and why each is set:

The common switches of each build system are explained in the Flag glossary.

4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/nodejs, prunes what the image does not ship, lints the tree and rolls it reproducibly:

tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
    --mtime=@$SOURCE_DATE_EPOCH \
    --use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
    -cf nodejs-26.10.0-1.tar.xz -C "$PKG" .

5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/nodejs, and runs the triggers its paths call for.

Contents

Installed programs: node, npm, npx.

Installed directories: /usr/include/node, /usr/lib/node_modules/npm, /usr/share/doc/node, /usr/share/licenses/nodejs.

Short descriptions

node server-side JavaScript runtime
npm javascript package manager npm Note: This command is unaware of workspaces.
npx Run a command from a local or remote npm package npx -- <pkg>@<version> args... npx --package=<pkg>@<version> -- <cmd> args... npx -c '<cmd> args...' npx --package=foo -c '<cmd> args...'

Notes

The patch and install lines at the top of build.sh belong together. The patch makes V8 compile Temporal’s time-zone rules into the binary from the zoneinfo64 crate’s zoneinfo64.res, and the install line then replaces that file with the one the icu port compiles from its own source, under /usr/share/icu/<version>/. The rules Temporal uses are therefore the system ICU’s tz release, but set when Node is built: an icu update with new time-zone rules reaches Intl at once and reaches Temporal only when this port is rebuilt. The path is read from pkg-config --modversion icu-uc, so it follows the installed icu without an edit here.

npm installs its manual pages inside its own module, under /usr/lib/node_modules/npm/man/, where man does not look. The loop at the end copies each section into /usr/share/man, so man npm-install works.