From fd2e404ba95aec6a478ce55af9bdd7b8280e4402 Mon Sep 17 00:00:00 2001 From: "exe.dev user" Date: Tue, 21 Apr 2026 15:05:52 +0000 Subject: [PATCH] fix(setup): auto-install Node and bypass corepack prompt Node check now triggers setup/install-node.sh when missing/too old, and COREPACK_ENABLE_DOWNLOAD_PROMPT=0 prevents the first-use prompt from hanging the script when stdout is redirected to the log. Co-Authored-By: Claude Opus 4.7 (1M context) --- setup.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/setup.sh b/setup.sh index af2c5e5..e163df8 100755 --- a/setup.sh +++ b/setup.sh @@ -72,6 +72,11 @@ install_deps() { cd "$PROJECT_ROOT" + # Corepack's first-use "Do you want to continue? [Y/n]" prompt would hang + # the script since we redirect stdout/stderr to the log file — the prompt + # is invisible but corepack still blocks on stdin. Auto-accept. + export COREPACK_ENABLE_DOWNLOAD_PROMPT=0 + # Enable corepack so `pnpm` shim lands on PATH. log "Enabling corepack" corepack enable >> "$LOG_FILE" 2>&1 || true @@ -131,6 +136,16 @@ log "=== Bootstrap started ===" detect_platform check_node +if [ "$NODE_OK" = "false" ]; then + log "Node missing or too old — running setup/install-node.sh" + echo "Node not found — installing via setup/install-node.sh" + if bash "$PROJECT_ROOT/setup/install-node.sh" 2>&1 | tee -a "$LOG_FILE"; then + hash -r 2>/dev/null || true + check_node + else + log "install-node.sh failed" + fi +fi install_deps check_build_tools