fix: suppress interactive dpkg prompts during fly VM setup (#1626)

tzdata (pulled in as a Node.js dependency) tries to run
dpkg-reconfigure interactively, which fails on headless Fly
machines. Set DEBIAN_FRONTEND=noninteractive so apt silently
accepts defaults.

Co-authored-by: lab <6723574+louisgv@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
A 2026-02-21 14:35:27 -08:00 committed by GitHub
parent 8f47fac0c2
commit cbecb9cbea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 3 additions and 2 deletions

View file

@ -129,7 +129,7 @@ async function installClaudeCode(): Promise<void> {
`export PATH="${claudePath}:$PATH"`,
`if command -v claude >/dev/null 2>&1; then ${finalize}; exit 0; fi`,
// Ensure Node.js for npm method
`if ! command -v node >/dev/null 2>&1; then apt-get install -y nodejs npm 2>/dev/null && 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 || true; fi`,
`if ! command -v node >/dev/null 2>&1; then DEBIAN_FRONTEND=noninteractive apt-get install -y nodejs npm 2>/dev/null && 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 || true; fi`,
// Method 2: npm
`echo "==> Installing Claude Code (method 2/2: npm)..."`,
`npm install -g @anthropic-ai/claude-code || true`,

View file

@ -746,6 +746,7 @@ export async function waitForCloudInit(): Promise<void> {
// round-trips (each of which was previously a separate fly machine exec call).
const setupScript = [
`echo "==> Installing base packages..."`,
`export DEBIAN_FRONTEND=noninteractive`,
`apt-get update -y && apt-get install -y curl unzip git || true`,
`echo "==> Checking Node.js..."`,
`if ! command -v node >/dev/null 2>&1; then { curl -fsSL https://deb.nodesource.com/setup_22.x | bash - && apt-get install -y nodejs; } || apt-get install -y nodejs || true; fi`,