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
nodejs-26.10.0.tar.xz(59.2 MiB)
sha2567b3a546d33cb7e15a43bdd7a57e0be5d5fd5ffc553e6e4c120033e66f0ba20c5
upstream: https://nodejs.org/dist/v26.10.0/node-v26.10.0.tar.xz
archive copy: sources-3/lang--nodejs-26.10.0.tar.xz
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.
v8-temporal-system-icu.patch— Enable Temporal with system ICU via baked zoneinfo64 dataV8 loads Temporal's timezone data through the ICU-internal udatamem.h API, which system ICU does not provide, so configuring with --with-intl=system-icu leaves Temporal disabled. Always use the baked zoneinfo64 data path that V8 already uses for builds without intl instead; the zoneinfo64.res input is vendored in the release tarball as part of the zoneinfo64 crate.
Patch-Source: https://github.com/nodejs/node/pull/62766
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:
CFLAGS="${CFLAGS/-O2/-O3}"— Raises the tree’s-O2to-O3in bothCFLAGSandCXXFLAGS. Node’s Release configuration (common.gypi) compiles at-O3, and the exported flags come after it on every compile line, so without this the tree’s-O2would win and Node would build below its own Release level.--shared-cares— Links the system c-ares, Node’s asynchronous DNS resolver, instead of the copy indeps/cares.--shared-zlib— Links the system zlib instead ofdeps/zlib.--shared-libuv— Links the system libuv, the event loop, instead ofdeps/uv.--shared-openssl— Links the system OpenSSL instead of the copy indeps/openssl, sonodecarries no TLS library of its own.--openssl-use-def-ca-store— Trusts OpenSSL’s own certificate store,/etc/ssl, instead of the copy of Mozilla’s CA list compiled into Node. A certificate the system trusts is then trusted by Node too.--shared-zstd— Links the system zstd instead ofdeps/zstd.--shared-ffi— Links the system libffi, which Node’s foreign-function interface uses, instead ofdeps/libffi.--shared-brotli— Links the system brotli instead ofdeps/brotli.--shared-nghttp2— Links the system nghttp2, Node’s HTTP/2 library, instead ofdeps/nghttp2.--shared-sqlite— Linksnode:sqliteagainst the system SQLite instead ofdeps/sqlite.node:sqlitecallssqlite3session_*andsqlite3_column_table_name, so the sqlite port must keep its session extension (--session) and column metadata (SQLITE_ENABLE_COLUMN_METADATA); without them this build fails to link.--v8-enable-temporal-support— Builds V8’sTemporaldate and time API. Without the switch, configure turns Temporal off with only a warning whenever--with-intl=system-icuis given, and also when it finds nocargoorrustc; with it, a missing Rust toolchain stops configure. The Rust crates Temporal is written in are vendored in the tarball underdeps/crates, and rust is independsfor this.--with-intl=system-icu— TakesIntl, Unicode and time-zone support from the system ICU (icu) instead of the ICU subset indeps/icu-small. This is what the Temporal patch works around: V8 reaches Temporal’s time-zone data through an ICU header that a system ICU does not install.
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.