Is there an existing issue for this?
This issue exists in the latest npm version
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:
|
// 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
- Create a
package.json file
- Add a pre-release
version (ex: "2.0.0-beta.1")
- Add a
publishConfig with a tag (ex: "beta")
- Run
npm publish
- 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
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
Running
npm publishwith the followingpackage.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
Expected Behavior
I expect the package to be published successfully.
Steps To Reproduce
package.jsonfileversion(ex: "2.0.0-beta.1")publishConfigwith atag(ex: "beta")npm publishnpm error You must specify a tag using --tag when publishing a prerelease version.Environment