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:
@@ -6246,7 +6246,7 @@ function setup_nodejs() {
|
|||||||
ensure_apt_working || return 1
|
ensure_apt_working || return 1
|
||||||
|
|
||||||
# Just update npm to latest
|
# 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"
|
cache_installed_version "nodejs" "$NODE_VERSION"
|
||||||
msg_ok "Update Node.js $NODE_VERSION"
|
msg_ok "Update Node.js $NODE_VERSION"
|
||||||
@@ -6314,7 +6314,7 @@ function setup_nodejs() {
|
|||||||
local NPM_VERSION
|
local NPM_VERSION
|
||||||
NPM_VERSION=$(npm -v 2>/dev/null || echo "0")
|
NPM_VERSION=$(npm -v 2>/dev/null || echo "0")
|
||||||
if [[ "$NPM_VERSION" != "0" ]]; then
|
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)"
|
msg_warn "Failed to update npm to latest version (continuing with bundled npm $NPM_VERSION)"
|
||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user