From 4dd9806af17de63dfaf5bf9225f5ba64010bdd61 Mon Sep 17 00:00:00 2001 From: Jarvis Date: Wed, 24 Jun 2026 16:56:48 -0500 Subject: [PATCH] fix(installer): clearer pnpm/corepack errors + dev-aware --check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Review follow-ups on the --dev feature: - Pin corepack to pnpm@10.6.2 (the repo packageManager) and surface corepack enable/prepare failures, with an actionable hard-fail when pnpm is still absent — the fresh-machine path no longer dies on a bare "command not found". - `--check --dev` now reports the installed version instead of a misleading "Could not reach registry" warning (dev mode skips the registry lookup). Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01RMoEx7hfdFGjUiCHuN1RRi --- tools/install.sh | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/tools/install.sh b/tools/install.sh index 00e306b..a1c509d 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -305,13 +305,21 @@ install_cli_from_source() { local out_dir="$WORK_DIR/dist-tarballs" mkdir -p "$out_dir" - # pnpm via corepack (ships with Node >= 16.9; required by Node >= 20 preflight) + # pnpm via corepack (ships with Node >= 16.9; required by Node >= 20 preflight). + # Pin to the repo's packageManager version so the build matches CI. Surface + # corepack failures so the fresh-machine case gives an actionable error + # instead of a bare "command not found". if ! command -v pnpm &>/dev/null; then info "Activating pnpm via corepack…" - corepack enable >/dev/null 2>&1 || true - corepack prepare pnpm@latest --activate >/dev/null 2>&1 || true + corepack enable 2>&1 | sed 's/^/ /' || warn "corepack enable failed — pnpm may need manual install." + corepack prepare pnpm@10.6.2 --activate 2>&1 | sed 's/^/ /' \ + || warn "corepack prepare failed — pnpm may need manual install." + fi + if ! command -v pnpm &>/dev/null; then + fail "pnpm not available after corepack activation." + echo " Install pnpm manually (https://pnpm.io/installation) and re-run with --dev." + exit 1 fi - require_cmd pnpm info "Installing workspace dependencies (pnpm install)…" ( cd "$src" && pnpm install ) 2>&1 | sed 's/^/ /' @@ -469,7 +477,9 @@ if [[ "$FLAG_CLI" == "true" ]]; then echo "" if [[ "$FLAG_CHECK" == "true" ]]; then - if [[ -z "$LATEST" ]]; then + if [[ "$FLAG_DEV" == "true" ]]; then + info "Dev mode: installed version is ${CURRENT:-(none)} (no registry comparison)." + elif [[ -z "$LATEST" ]]; then warn "Could not reach registry." elif [[ -z "$CURRENT" ]]; then warn "Not installed."