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."