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
This commit is contained in:
+8
-2
@@ -585,12 +585,18 @@ echo "── npm global packages (system-wide) ──"
|
|||||||
if ! has npm; then
|
if ! has npm; then
|
||||||
warn "npm not found — skipping global package installs"
|
warn "npm not found — skipping global package installs"
|
||||||
else
|
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)
|
# Pi (coding agent)
|
||||||
if has pi; then
|
if has pi; then
|
||||||
skip "pi (@mariozechner/pi-coding-agent)"
|
skip "pi (@mariozechner/pi-coding-agent)"
|
||||||
else
|
else
|
||||||
echo " Installing pi..."
|
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
|
if has pi; then ok "pi installed"; else warn "pi install failed"; fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -616,7 +622,7 @@ else
|
|||||||
skip "claude (@anthropic-ai/claude-code)"
|
skip "claude (@anthropic-ai/claude-code)"
|
||||||
else
|
else
|
||||||
echo " Installing claude-code..."
|
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
|
if has claude; then ok "claude-code installed"; else warn "claude-code install failed"; fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user