From 2d81b7655d57d1d8b0f86a3642d90da61a1e6fde Mon Sep 17 00:00:00 2001 From: James Wampler Date: Sat, 4 Jul 2026 18:29:52 -0700 Subject: [PATCH] Install Node via apk on musl runners instead of nodejs.org's glibc tarball Same runner dotnet-install.sh detects as musl and picks linux-musl-x64 for - the glibc node tarball can't even exec there ("env: can't execute 'node'"). --- scripts/ci/lib.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/scripts/ci/lib.sh b/scripts/ci/lib.sh index e0c98d6..14f1337 100755 --- a/scripts/ci/lib.sh +++ b/scripts/ci/lib.sh @@ -91,6 +91,20 @@ ensure_node() { return 0 fi + # nodejs.org only ships glibc binaries; on a musl/Alpine runner (same one + # dotnet-install.sh detects and picks the linux-musl-x64 SDK for) that + # tarball fails to exec at all ("env: can't execute 'node'"). Prefer the + # distro's own package on musl instead of a broken glibc download. + if [[ ! -x "$CI_ROOT/.node/bin/node" ]] && command -v apk > /dev/null 2>&1; then + log "node not found on PATH; installing via apk (musl runner)" + local sudo_cmd="" + if [[ "$(id -u)" -ne 0 ]] && command -v sudo > /dev/null 2>&1; then + sudo_cmd="sudo" + fi + $sudo_cmd apk add --no-cache nodejs npm + return 0 + fi + local node_version="22.14.0" local install_dir="$CI_ROOT/.node" if [[ ! -x "$install_dir/bin/node" ]]; then