[BUG] npm publish prints "with tag latest" and accepts a semver-range tag when the tag comes from publishConfig
メンテナーはふだん 2 日以内に返信
評価
- 難易度
- 3/5
- 見積もり時間
- 半日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- javascript, nodejs
調査の方向性
The publish notice and tag handling live in the npm CLI publish command; start by reading the publish implementation where the publishConfig tag is merged with the --tag option, and the dist-tag code that rejects SemVer ranges. Reproduce with the steps in the issue using a dry run. Done when the notice prints the tag actually used and a SemVer-range publishConfig tag is refused like --tag 1.x; note that pull request 10290 already targets this, so check it before starting.
索引モデルが issue の本文から書いたものです。
説明
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
With "publishConfig": { "tag": "next" } in package.json, npm publish prints Publishing to https://registry.npmjs.org/ with tag latest, but the package is actually published under the next dist-tag.
With "publishConfig": { "tag": "1.x" }, the publish goes through and creates a 1.x dist-tag.
The same tag passed as --tag 1.x, or with npm dist-tag add, is refused with Tag name must not be a valid SemVer range: 1.x.
Expected Behavior
The notice should show the tag that is actually used (next), and a semver-range tag from publishConfig should be refused the same way as --tag 1.x.
Steps To Reproduce
mkdir pc-tag && cd pc-tag
echo '{"name":"publishconfig-tag-demo","version":"1.0.0","publishConfig":{"tag":"next"}}' > package.json
npm publish --dry-run
# npm notice Publishing to https://registry.npmjs.org/ with tag latest and default access (dry-run)
# change the tag to a semver range
echo '{"name":"publishconfig-tag-demo","version":"1.0.0","publishConfig":{"tag":"1.x"}}' > package.json
npm publish --dry-run
# succeeds, still says "with tag latest"
npm publish --dry-run --tag 1.x
# npm error Tag name must not be a valid SemVer range: 1.x
Environment
- npm: 12.2.2 (also on the
latestbranch at 8f92e74) - Node.js: 22.23.4
- OS Name: Linux
- npm config: defaults
- 主要言語
- JavaScript
- スター
- 10.3k
- フォーク
- 5k
- 平均マージ
- 4日 11時間
- マージ済み PR(30日)
- 26
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
npm/cli のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 2 日以内に返信
-
[BUG] scripts/dependency-graph.js splits npm-cli-repos.txt on os.EOL, so DEPENDENCIES.md depends on the checkout's line endings対応中かも @saruk-vedant が 7 日前に担当しました。 オープンBug Needs Triage Triage Requested
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 2 日以内に返信
-
[BUG] npm pkg delete removes the first array item for a nonexistent property対応中かも @drawliin が 42 日前に担当しました。 オープンcmd:delete Priority 3
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
メンテナーはふだん 2 日以内に返信
-
create node pr: Node.js 20 deprecation & `DEP0040` warnings logged再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープンEngineering Priority 1
難易度 1/5 1時間未満 初心者へのやさしさ 80/100
メンテナーはふだん 2 日以内に返信
-
`npm audit signatures` does not report how many packages it skipped for want of registry keys対応中かも @greenlincoln05 が 63 日前に担当しました。 オープンPriority 3
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 2 日以内に返信
似ている issue
-
docs: add SECURITY.md vulnerability reporting policy対応中かも @AK-Lmn が今日担当しました。 オープン
難易度 1/5 1〜3時間 初心者へのやさしさ 72/100
flisk-sh/linux2wasm#12 ·
メンテナーはふだん 1 日以内に返信
-
possible bug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
Mintplex-Labs/anything-llm#7388 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 60/100
メンテナーはふだん 1 日以内に返信
-
v6: Minified bootstrap.min.css is missing header info対応中かも @lazerg が今日担当しました。 オープンbug build confirmed has-pr v6
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
documentation
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
githubnext/gh-aw-workshop#6332 ·
メンテナーはふだん 1 日以内に返信