From aee9f8fbc1b8ec8e991c8f3404e9cd03ed497e88 Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Thu, 26 Mar 2026 09:50:45 +0100 Subject: [PATCH] fix(tools.func): pin npm to 11.11.0 to work around Node.js 22.22.2 regression Node.js 22.22.2 ships with a broken npm self-upgrade path where 'npm install -g npm@latest' fails with MODULE_NOT_FOUND for promise-retry. Pin to npm@11.11.0 as a known-good version until the upstream issue is resolved. Ref: nodejs/node#62425, npm/cli#9151 --- misc/tools.func | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/misc/tools.func b/misc/tools.func index 56b18d8a6..bd7aa4070 100644 --- a/misc/tools.func +++ b/misc/tools.func @@ -6233,8 +6233,8 @@ function setup_nodejs() { ensure_apt_working || return 1 - # Just update npm to latest - $STD npm install -g npm@latest 2>/dev/null || true + # Pin npm to 11.11.0 to work around Node.js 22.22.2 regression (nodejs/node#62425) + $STD npm install -g npm@11.11.0 2>/dev/null || true cache_installed_version "nodejs" "$NODE_VERSION" msg_ok "Update Node.js $NODE_VERSION" @@ -6298,12 +6298,12 @@ function setup_nodejs() { return 1 fi - # Update to latest npm (with version check to avoid incompatibility) + # Pin npm to 11.11.0 to work around Node.js 22.22.2 regression (nodejs/node#62425) local NPM_VERSION NPM_VERSION=$(npm -v 2>/dev/null || echo "0") if [[ "$NPM_VERSION" != "0" ]]; then - $STD npm install -g npm@latest 2>/dev/null || { - msg_warn "Failed to update npm to latest version (continuing with bundled npm $NPM_VERSION)" + $STD npm install -g npm@11.11.0 2>/dev/null || { + msg_warn "Failed to update npm to 11.11.0 (continuing with bundled npm $NPM_VERSION)" } fi