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

未关闭
#9,889 2 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
38/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
活跃
领域
cli

调研方向

首先,重现链接的 GitHub Actions 运行中的发布失败,并将 package 的 registry 状态与 npm stage list 和 npm stage reject 进行比较。跟踪 npm CLI 对 staged-version 冲突的处理,并确定为什么一个既不在 packument 中、也不在 staged-version 列表中的 package 会被拒绝。完成的标准是确定一个可重现的原因,并为受影响的发布路径添加回归测试。

由索引模型根据 Issue 内容生成。

描述

Bug Registry
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/[email protected] 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
主要语言
JavaScript
星标
10.3k
派生
5k
平均合并
4 天 11 小时
30 天内合并 PR
26

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

npm/cli 的其他 Issue

查看 npm/cli 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。