From 8901c5660e392039441e72fd8b24e3a92dc66e8b Mon Sep 17 00:00:00 2001 From: dr-js Date: Wed, 6 Jan 2021 09:28:37 +0800 Subject: [PATCH] fix: publish: skip login check on dry-run --- lib/publish.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/publish.js b/lib/publish.js index 60e2a666577e4..257898f0272c5 100644 --- a/lib/publish.js +++ b/lib/publish.js @@ -84,7 +84,7 @@ const publish_ = async (arg, opts) => { } const creds = npm.config.getCredentialsByURI(registry) - if (!creds.token && !creds.username) { + if (!dryRun && !creds.token && !creds.username) { throw Object.assign(new Error('This command requires you to be logged in.'), { code: 'ENEEDAUTH', })