Skip to content

Use the channel's dist-tag when counting published prereleases #163

Closed

Description

@Akkuma

We are publishing to GCP's registry on an alpha channel. Our second channel publish tried to reuse 0.1.0-alpha.0 for every package, and the registry rejected each one with "Requested version(0.1.0-alpha.0) already exists".

bumpy finds the next prerelease number with npm info <name> versions --json. That command doesn't list every version. When the spec has no version, npm looks the package up through its tag config, which defaults to latest. If the package has no latest dist-tag, npm prints nothing and exits 0. You can see this in npm 11's lib/commands/view.js, which throws "No match found" for any other tag but returns quietly for latest. bumpy then fails on JSON.parse(""), the catch returns [], and the counter starts over at 0.

npmjs.org always sets latest on a package's first publish I'm guessing, so this doesn't show up there. GCP only appears to set the dist-tag you publish with. We ran these on the CI runner after the first alpha publish:

Command Output
npm info @scope/pkg@0.1.0-alpha.0 dist-tags --json {"alpha": "0.1.0-alpha.0"}
npm info @scope/pkg versions --json nothing, exit 0
npm_config_tag=alpha npm info @scope/pkg versions --json ["0.1.0-alpha.0"]

Our workaround is to explicitly set npm_config_tag based on the branch.

Activity

  1. pullfrog commented on Oct 14, 2026

    @pullfrog
  2. theoephraim commented on Oct 14, 2026

    @theoephraim
    Member

    Thanks for this report! Hard to froresee these things without real workflows exercising them.
    Will get it sorted asap.

  3. added a commit that references this issue on Oct 15, 2026
    e701d4b
  4. github-actions commented on Oct 15, 2026

    @github-actions

    ✅ A fix has been merged to main in #164 and will ship in the next release.

    GitHub auto-closed this issue on merge, but the change isn't published yet — it'll go out with the next bumpy release. 🐸

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions