-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Closed
Labels
Description
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:
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
- Create a
package.jsonfile - Add a pre-release
version(ex: "2.0.0-beta.1") - Add a
publishConfigwith atag(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