From cc18aa7bcb5fe5549ba49eda259ece19be31ba12 Mon Sep 17 00:00:00 2001 From: Anthony Ettinger Date: Wed, 14 Oct 2026 23:50:43 +0000 Subject: [PATCH] install.sh: npm first, pnpm fallback, say where the bin went pnpm add -g aborts unless pnpm's global bin directory was configured beforehand, so the curl installer failed on a box with pnpm on PATH. Co-Authored-By: Claude Opus 5.5 --- src/dashboard.ts | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/dashboard.ts b/src/dashboard.ts index 1e1fd79..b8759b4 100644 --- a/src/dashboard.ts +++ b/src/dashboard.ts @@ -184,11 +184,20 @@ if [ "$major" -lt 22 ]; then echo "submitfleet needs Node.js 22.5 or newer (found $(node -v))" >&2 exit 1 fi -if command -v pnpm >/dev/null 2>&1; then - pnpm add -g @profullstack/submitfleet +# npm first: its global bin works out of the box. pnpm only when npm is missing or fails +# (pnpm add -g aborts unless its global bin directory was set up beforehand). +if command -v npm >/dev/null 2>&1 && npm install -g @profullstack/submitfleet; then + bin_dir="$(npm prefix -g)/bin" +elif command -v pnpm >/dev/null 2>&1 && pnpm add -g @profullstack/submitfleet; then + bin_dir="$(pnpm bin -g)" else - npm install -g @profullstack/submitfleet + echo "submitfleet: install failed (tried npm and pnpm)" >&2 + exit 1 +fi +if command -v submitfleet >/dev/null 2>&1; then + submitfleet doctor || true + echo "Installed. Try: submitfleet coverage report" +else + echo "Installed to $bin_dir, which is not on your PATH. Add it, then run: submitfleet doctor" fi -submitfleet doctor || true -echo "Installed. Try: submitfleet coverage report" `;