[BUG] npm publish prints "with tag latest" and accepts a semver-range tag when the tag comes from publishConfig
I maintainer di solito rispondono entro 2 giorni
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- Mezza giornata
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- javascript, nodejs
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- JavaScript
- Stelle
- 10.3k
- Fork
- 5k
- Merge medio
- 4g 11h
- PR unite (30g)
- 26
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di npm/cli
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 2 giorni
-
[BUG] scripts/dependency-graph.js splits npm-cli-repos.txt on os.EOL, so DEPENDENCIES.md depends on the checkout's line endingsForse già presa @saruk-vedant l’ha presa 7 giorni fa. ApertaBug Needs Triage Triage Requested
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 2 giorni
-
[BUG] npm pkg delete removes the first array item for a nonexistent propertyForse già presa @drawliin l’ha presa 42 giorni fa. Apertacmd:delete Priority 3
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
I maintainer di solito rispondono entro 2 giorni
-
create node pr: Node.js 20 deprecation & `DEP0040` warnings loggedForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. ApertaEngineering Priority 1
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 80/100
I maintainer di solito rispondono entro 2 giorni
-
`npm audit signatures` does not report how many packages it skipped for want of registry keysForse già presa @greenlincoln05 l’ha presa 63 giorni fa. ApertaPriority 3
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 2 giorni
Issue simili
-
docs: add SECURITY.md vulnerability reporting policyForse già presa @AK-Lmn l’ha presa oggi. Aperta
Difficoltà 1/5 1-3 ore Idoneità per principianti 72/100
flisk-sh/linux2wasm#12 ·
I maintainer di solito rispondono entro 1 giorno
-
possible bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
Mintplex-Labs/anything-llm#7388 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 60/100
I maintainer di solito rispondono entro 1 giorno
-
v6: Minified bootstrap.min.css is missing header infoForse già presa @lazerg l’ha presa oggi. Apertabug build confirmed has-pr v6
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
documentation
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
githubnext/gh-aw-workshop#6332 ·
I maintainer di solito rispondono entro 1 giorno