Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLuke Karrys <luke@lukekarrys.com>2021-12-09 02:07:23 +0300
committernlf <quitlahok@gmail.com>2021-12-09 02:29:02 +0300
commit166d9e144b38087ee5e7d8aaf6ec7d602cf2957c (patch)
treee5f0f4991a4077355837a1b2ba991576aca6afc4 /lib
parente605b128c87620aae843cdbd8f35cc614da3f8a2 (diff)
fix: output configured registry during publish
Closes: npm/statusboard#416 PR-URL: https://github.com/npm/cli/pull/4143 Credit: @lukekarrys Close: #4143 Reviewed-by: @wraithgar
Diffstat (limited to 'lib')
-rw-r--r--lib/commands/publish.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/commands/publish.js b/lib/commands/publish.js
index ad538668b..b82093749 100644
--- a/lib/commands/publish.js
+++ b/lib/commands/publish.js
@@ -104,11 +104,15 @@ class Publish extends BaseCommand {
const resolved = npa.resolve(manifest.name, manifest.version)
const registry = npmFetch.pickRegistry(resolved, opts)
const creds = this.npm.config.getCredentialsByURI(registry)
+ const outputRegistry = replaceInfo(registry)
if (!creds.token && !creds.username) {
- throw Object.assign(new Error('This command requires you to be logged in.'), {
- code: 'ENEEDAUTH',
- })
+ throw Object.assign(
+ new Error(`This command requires you to be logged in to ${outputRegistry}`), {
+ code: 'ENEEDAUTH',
+ }
+ )
}
+ log.notice('', `Publishing to ${outputRegistry}`)
await otplease(opts, opts => libpub(manifest, tarballData, opts))
}