mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-05-08 01:51:14 +00:00
The nodesource setup_22.x script can run successfully but leave nodejs uninstalled on Fly.io machines. Add post-install verification with `which node && node --version`, fall back to default Debian nodejs package if nodesource fails, increase timeout from 120s to 180s, and report a clear error if node is unavailable after all attempts. Agent: code-health Co-authored-by: B <6723574+louisgv@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
51493ccc75
commit
279eddd689
1 changed files with 13 additions and 3 deletions
|
|
@ -448,9 +448,19 @@ wait_for_cloud_init() {
|
|||
log_warn "Package install failed, continuing anyway..."
|
||||
}
|
||||
log_step "Installing Node.js..."
|
||||
_fly_run_with_retry 3 10 120 "curl -fsSL https://deb.nodesource.com/setup_22.x | bash - && apt-get install -y nodejs" || {
|
||||
log_warn "Node.js install failed after retries, npm-based agents may not work"
|
||||
}
|
||||
_fly_run_with_retry 3 10 180 "curl -fsSL https://deb.nodesource.com/setup_22.x | bash - && apt-get install -y nodejs" || true
|
||||
# Verify node is actually installed — nodesource setup can succeed but leave node missing (#1581)
|
||||
if ! run_server "which node && node --version" 15 >/dev/null 2>&1; then
|
||||
log_warn "Node.js not found after nodesource install, falling back to default Debian package..."
|
||||
_fly_run_with_retry 2 5 120 "apt-get install -y nodejs" || true
|
||||
if ! run_server "which node && node --version" 15 >/dev/null 2>&1; then
|
||||
log_error "Node.js is NOT installed — npm-based agents will not work"
|
||||
else
|
||||
log_info "Node.js installed from default Debian repos: $(run_server 'node --version' 10 2>/dev/null)"
|
||||
fi
|
||||
else
|
||||
log_info "Node.js installed: $(run_server 'node --version' 10 2>/dev/null)"
|
||||
fi
|
||||
log_step "Installing bun..."
|
||||
_fly_run_with_retry 2 5 120 "curl -fsSL https://bun.sh/install | bash" || true
|
||||
run_server 'echo "export PATH=\"\$HOME/.local/bin:\$HOME/.bun/bin:\$PATH\"" >> ~/.bashrc' 30 || true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue