Skip to content

Commit aee9f8f

Browse files
committed
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
1 parent d915dee commit aee9f8f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

misc/tools.func

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6233,8 +6233,8 @@ function setup_nodejs() {
62336233
62346234
ensure_apt_working || return 1
62356235
6236-
# Just update npm to latest
6237-
$STD npm install -g npm@latest 2>/dev/null || true
6236+
# Pin npm to 11.11.0 to work around Node.js 22.22.2 regression (nodejs/node#62425)
6237+
$STD npm install -g npm@11.11.0 2>/dev/null || true
62386238
62396239
cache_installed_version "nodejs" "$NODE_VERSION"
62406240
msg_ok "Update Node.js $NODE_VERSION"
@@ -6298,12 +6298,12 @@ function setup_nodejs() {
62986298
return 1
62996299
fi
63006300
6301-
# Update to latest npm (with version check to avoid incompatibility)
6301+
# Pin npm to 11.11.0 to work around Node.js 22.22.2 regression (nodejs/node#62425)
63026302
local NPM_VERSION
63036303
NPM_VERSION=$(npm -v 2>/dev/null || echo "0")
63046304
if [[ "$NPM_VERSION" != "0" ]]; then
6305-
$STD npm install -g npm@latest 2>/dev/null || {
6306-
msg_warn "Failed to update npm to latest version (continuing with bundled npm $NPM_VERSION)"
6305+
$STD npm install -g npm@11.11.0 2>/dev/null || {
6306+
msg_warn "Failed to update npm to 11.11.0 (continuing with bundled npm $NPM_VERSION)"
63076307
}
63086308
fi
63096309

0 commit comments

Comments
 (0)