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.
This commit is contained in:
Jarvis
2026-04-01 21:06:40 -05:00
parent 45f5b9062e
commit 2f68237046
2 changed files with 9 additions and 5 deletions

View File

@@ -340,10 +340,12 @@ program
console.log('Installing update…'); console.log('Installing update…');
try { try {
execSync( // Relies on @mosaic:registry in ~/.npmrc — do NOT pass --registry
'npm install -g @mosaic/cli@latest --registry=https://git.mosaicstack.dev/api/packages/mosaic/npm/', // globally or non-@mosaic deps will 404 against the Gitea registry.
{ stdio: 'inherit', timeout: 60_000 }, execSync('npm install -g @mosaic/cli@latest', {
); stdio: 'inherit',
timeout: 60_000,
});
console.log('\n✔ Updated successfully.'); console.log('\n✔ Updated successfully.');
} catch { } catch {
console.error('\nUpdate failed. Try manually: bash tools/install.sh'); console.error('\nUpdate failed. Try manually: bash tools/install.sh');

View File

@@ -189,8 +189,10 @@ else
exit 0 exit 0
fi 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}" \ npm install -g "${CLI_PKG}@${LATEST}" \
--registry="$REGISTRY" \
--prefix="$PREFIX" \ --prefix="$PREFIX" \
2>&1 | sed 's/^/ /' 2>&1 | sed 's/^/ /'