npm / npm/cli

[BUG] 409 "Cannot publish over previously staged version" for a package that never used staged publishing

Open
#9,889 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Bug Registry
Dominant language
JavaScript
Stars
10.1k
Forks
4.7k
Avg merge
2d 2h
Merged PRs (30d)
19

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
This is not just a request to bump a dependency for a CVE
  • This is not solely a request to bump a dependency for a CVE
Current Behavior

@rspack/binding-linux-x64-musl@2.2.0-beta.0 cannot be published. Every attempt returns:

409 Conflict - PUT https://registry.npmjs.org/@rspack%2fbinding-linux-x64-musl
Cannot publish over previously staged version "2.2.0-beta.0".

We never used staged publishing — no npm stage publish, and it is not enabled for the package
or the @rspack org. Publishing is done from GitHub Actions via OIDC trusted publishing with
pnpm publish -r --tag beta --provenance (pnpm 11.8.0, Node 24.19.0).

The version does not exist as a published version (npm view → E404, absent from the packument
and from /-/npm/v1/attestations), and it does not appear as a staged version either —
npm stage list returns nothing, filtered by package or unfiltered, from a maintainer account.
So there is no stage-id to pass to npm stage reject, and no way for us to clear it.

The first publish that triggered this reported success and the process went on to publish the
next package normally; that one is live. Only this package ended up wedged.

Failing run: https://github.com/web-infra-dev/rspack/actions/runs/32102630939

Expected Behavior

No response

Steps To Reproduce
  1. In this environment...
  2. With this config...
  3. Run '...'
  4. See error...
Environment
  • npm:
  • Node.js:
  • OS Name:
  • System Model Name:
  • npm config:
; copy and paste output from `npm config ls` here

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the failed publish from the linked GitHub Actions run and compare the package's registry state with npm stage list and npm stage reject. Trace the npm CLI handling of the staged-version conflict and determine why a package absent from both the packument and staged-version listing is rejected. Done means identifying a reproducible cause and adding a regression test for the affected publish path.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.