From 1d731fd3f3bb1534d5705ac74f8e91aa28761ff1 Mon Sep 17 00:00:00 2001 From: Jarvis Date: Wed, 1 Apr 2026 21:06:40 -0500 Subject: [PATCH] fix: remove --registry from npm install to avoid 404 on transitive deps The @mosaic scope registry is configured in ~/.npmrc. Passing --registry on the install command overrides the default registry for ALL packages, causing non-@mosaic deps like @clack/prompts to 404 against Gitea. --- packages/cli/src/cli.ts | 10 ++++++---- tools/install.sh | 4 +++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/cli/src/cli.ts b/packages/cli/src/cli.ts index 21f6b94..dafacdc 100644 --- a/packages/cli/src/cli.ts +++ b/packages/cli/src/cli.ts @@ -340,10 +340,12 @@ program console.log('Installing update…'); try { - execSync( - 'npm install -g @mosaic/cli@latest --registry=https://git.mosaicstack.dev/api/packages/mosaic/npm/', - { stdio: 'inherit', timeout: 60_000 }, - ); + // Relies on @mosaic:registry in ~/.npmrc — do NOT pass --registry + // globally or non-@mosaic deps will 404 against the Gitea registry. + execSync('npm install -g @mosaic/cli@latest', { + stdio: 'inherit', + timeout: 60_000, + }); console.log('\n✔ Updated successfully.'); } catch { console.error('\nUpdate failed. Try manually: bash tools/install.sh'); diff --git a/tools/install.sh b/tools/install.sh index 2fd8d2e..15d6362 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -189,8 +189,10 @@ else exit 0 fi +# NOTE: Do NOT pass --registry here. The @mosaic scope is already mapped +# in ~/.npmrc. Passing --registry globally would redirect ALL deps (including +# @clack/prompts, commander, etc.) to the Gitea registry, causing 404s. npm install -g "${CLI_PKG}@${LATEST}" \ - --registry="$REGISTRY" \ --prefix="$PREFIX" \ 2>&1 | sed 's/^/ /'