We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 93fcf15 commit 0f7f1afCopy full SHA for 0f7f1af
lib/commands/publish.js
@@ -131,8 +131,8 @@ class Publish extends BaseCommand {
131
132
const resolved = npa.resolve(manifest.name, manifest.version)
133
134
- const latestDistTag = await this.#latestPublishedVersion(resolved)
135
- const latestTagIsGreater = latestDistTag ? semver.gte(latestDistTag, manifest.version) : false
+ const latestVersion = await this.#latestPublishedVersion(resolved)
+ const latestTagIsGreater = !!latestVersion && semver.gte(latestVersion, manifest.version)
136
137
if (latestTagIsGreater && isDefaultTag) {
138
throw new Error('Cannot publish a lower version without an explicit dist tag.')
0 commit comments