From a8976ad8fb0984b296f02981a8fd4c384fcea09c Mon Sep 17 00:00:00 2001 From: Andre Padez Date: Wed, 4 Mar 2026 02:16:07 +0000 Subject: [PATCH] improvement: use explicit system npm path to avoid nvm conflicts - When installing global npm packages, explicitly use /usr/bin/npm - Falls back to $(which npm) if system npm not found - Ensures packages go to system location, not nvm location - Works around nvm PATH interference during setup --- scripts/setup.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/setup.sh b/scripts/setup.sh index 6e764df6..039d8242 100755 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -585,12 +585,18 @@ echo "── npm global packages (system-wide) ──" if ! has npm; then warn "npm not found — skipping global package installs" else + # Use explicit path to system npm if available, to avoid nvm conflicts + SYSTEM_NPM="/usr/bin/npm" + if [ ! -f "$SYSTEM_NPM" ]; then + SYSTEM_NPM="$(which npm)" + fi + # Pi (coding agent) if has pi; then skip "pi (@mariozechner/pi-coding-agent)" else echo " Installing pi..." - sudo npm install -g @mariozechner/pi-coding-agent + sudo "$SYSTEM_NPM" install -g @mariozechner/pi-coding-agent if has pi; then ok "pi installed"; else warn "pi install failed"; fi fi @@ -616,7 +622,7 @@ else skip "claude (@anthropic-ai/claude-code)" else echo " Installing claude-code..." - sudo npm install -g @anthropic-ai/claude-code + sudo "$SYSTEM_NPM" install -g @anthropic-ai/claude-code if has claude; then ok "claude-code installed"; else warn "claude-code install failed"; fi fi