Content-Length: 277262 | pFad | https://github.com/npm/cli/issues/8017

C3 [BUG] npm 11 publish pre-release does not take publishConfig.tag into account · Issue #8017 · npm/cli · GitHub
Skip to content

[BUG] npm 11 publish pre-release does not take publishConfig.tag into account #8017

@Badisi

Description

@Badisi

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

Running npm publish with the following package.json:

{
    "name": "@hug/eslint-config",
    "version": "21.0.0-beta.8",
    "publishConfig": {
        "access": "public",
        "tag": "beta"
    },
    ...
}

produces the following error with npm@11.x:

npm error You must specify a tag using --tag when publishing a prerelease version.
npm error A complete log of this run can be found in: ....

@reggi, @wraithgar, I think the issue lies here, where manifest should also be used to retrieve the tag:

cli/lib/commands/publish.js

Lines 114 to 120 in 7f6c997

// The purpose of re-reading the manifest is in case it changed,
// so that we send the latest and greatest thing to the registry
// note that publishConfig might have changed as well!
manifest = await this.#getManifest(spec, opts, true)
const isPreRelease = Boolean(semver.parse(manifest.version).prerelease.length)
const isDefaultTag = this.npm.config.isDefault('tag')

Expected Behavior

I expect the package to be published successfully.

Steps To Reproduce

  1. Create a package.json file
  2. Add a pre-release version (ex: "2.0.0-beta.1")
  3. Add a publishConfig with a tag (ex: "beta")
  4. Run npm publish
  5. See error npm error You must specify a tag using --tag when publishing a prerelease version.

Environment

  • npm: 11.0.0
  • Node.js: v22.12.0
  • OS Name: macOS 15.2 (24C101)
  • System Model Name: Macbook Pro

Metadata

Metadata

Assignees

Labels

Bugthing that needs fixingPriority 1high priority issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions









    ApplySandwichStrip

    pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


    --- a PPN by Garber Painting Akron. With Image Size Reduction included!

    Fetched URL: https://github.com/npm/cli/issues/8017

    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy