fix(tools): don't use $STD for npm self-update

silent() hard-exits on non-zero rc, so the || fallback never
executes. Use plain redirect instead so npm update failures are
non-fatal as intended.
This commit is contained in:
MickLesk
2026-04-04 23:30:45 +02:00
parent 2c47d114db
commit 062a6f85fb

View File

@@ -6246,7 +6246,7 @@ function setup_nodejs() {
ensure_apt_working || return 1
# Just update npm to latest
$STD npm install -g npm@latest 2>/dev/null || true
npm install -g npm@latest >/dev/null 2>&1 || true
cache_installed_version "nodejs" "$NODE_VERSION"
msg_ok "Update Node.js $NODE_VERSION"
@@ -6314,7 +6314,7 @@ function setup_nodejs() {
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 || {
npm install -g npm@latest >/dev/null 2>&1 || {
msg_warn "Failed to update npm to latest version (continuing with bundled npm $NPM_VERSION)"
}
fi