fix: install Node.js runtime before bun method (npm package needs node) (#1266)

Co-authored-by: lab <6723574+louisgv@users.noreply.github.com>
This commit is contained in:
A 2026-02-16 01:30:26 -08:00 committed by GitHub
parent d851735eec
commit 05054021f3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1292,6 +1292,16 @@ install_claude_code() {
log_warn "curl installer failed (site may be temporarily unavailable)"
fi
# Ensure Node.js runtime for bun-installed package (it's a Node.js script)
if ! ${run_cb} "${claude_path} && command -v node" >/dev/null 2>&1; then
log_step "Installing Node.js runtime (required for claude package)..."
if ${run_cb} "curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - && apt-get install -y nodejs" >/dev/null 2>&1; then
log_info "Node.js installed via nodesource"
else
log_warn "Could not install Node.js - bun method may fail"
fi
fi
# Method 2: bun
log_step "Installing Claude Code (method 2/2: bun)..."
if ${run_cb} "${claude_path} && bun i -g @anthropic-ai/claude-code 2>&1" 2>&1; then