Skip to content

Commit ac664b2

Browse files
committed
fix(npm_global): initialize nvm for Node.js package managers
Problem: - ESLint and Claude Code upgrades failing with "node: not found" - pnpm successfully installs packages but version checks fail - Multiple manual installations shadowing pnpm installs - npm_global.sh runs in non-interactive shell without nvm loaded Changes: - Add nvm initialization to npm_global.sh before version checks - Load nvm.sh with --no-use flag to avoid startup messages - Activate default Node.js version for package manager access Resolution: - Removed manual installations at ~/.local/bin/{eslint,claude} - ESLint upgraded: 9.37.0 → 9.39.1 (pnpm) - Claude Code upgraded: 2.0.33 → 2.0.34 (pnpm) - Version detection now works correctly in installer scripts
1 parent a400255 commit ac664b2

2 files changed

Lines changed: 371 additions & 378 deletions

File tree

scripts/installers/npm_global.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ set -euo pipefail
55
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
66
. "$DIR/lib/install_strategy.sh"
77

8+
# Load nvm if available (needed for node-based package managers)
9+
export NVM_DIR="$HOME/.nvm"
10+
if [ -s "$NVM_DIR/nvm.sh" ]; then
11+
. "$NVM_DIR/nvm.sh" --no-use
12+
nvm use default >/dev/null 2>&1 || true
13+
fi
14+
815
TOOL="${1:-}"
916
if [ -z "$TOOL" ]; then
1017
echo "Usage: $0 TOOL_NAME" >&2

0 commit comments

Comments
 (0)