mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-05-21 18:52:56 +00:00
fix: drop apt nodejs/npm, install Node 22 directly via n (#1746)
apt-get install nodejs npm pulls in hundreds of node-* packages (libhwasan, node-jsonify, node-eslint-utils, etc.) adding 60-90s to cloud-init. We immediately replace it with Node 22 via n anyway. Fix: bootstrap n directly from curl and install Node 22 in one step. No apt nodejs/npm needed. Before: apt install nodejs npm → npm install -g n → n 22 (slow) After: curl n | bash -s install 22 (fast, no apt bloat) Co-authored-by: Claude <claude@anthropic.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
0a8e6a30ad
commit
57d4ee7eeb
9 changed files with 29 additions and 31 deletions
|
|
@ -15,7 +15,7 @@ import {
|
|||
toKebabCase,
|
||||
} from "../shared/ui";
|
||||
import type { CloudInitTier } from "../shared/agents";
|
||||
import { getPackagesForTier, needsNodeUpgrade, needsBun } from "../shared/cloud-init";
|
||||
import { getPackagesForTier, needsNode, needsBun, NODE_INSTALL_CMD } from "../shared/cloud-init";
|
||||
|
||||
const DASHBOARD_URL = "https://lightsail.aws.amazon.com/";
|
||||
|
||||
|
|
@ -461,10 +461,10 @@ function getCloudInitUserdata(tier: CloudInitTier = "full"): string {
|
|||
"apt-get update -y",
|
||||
`apt-get install -y --no-install-recommends ${packages.join(" ")}`,
|
||||
];
|
||||
if (needsNodeUpgrade(tier)) {
|
||||
if (needsNode(tier)) {
|
||||
lines.push(
|
||||
"# Upgrade Node.js to v22 LTS",
|
||||
"npm install -g n && n 22 && ln -sf /usr/local/bin/node /usr/bin/node && ln -sf /usr/local/bin/npm /usr/bin/npm && ln -sf /usr/local/bin/npx /usr/bin/npx",
|
||||
"# Install Node.js 22 via n",
|
||||
`su - ubuntu -c '${NODE_INSTALL_CMD}'`,
|
||||
"# Install Claude Code",
|
||||
"su - ubuntu -c 'curl -fsSL https://claude.ai/install.sh | bash'",
|
||||
"# Configure npm global prefix",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue