`npm update react --package-lock-only` fails with ERESOLVE where `npm update --package-lock-only` succeeds
I maintainer di solito rispondono entro 2 giorni
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 53/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- javascript, node.js
Direzione di ricerca
Start by reproducing the failure in npm 11.19.0 with the supplied repository commit and compare the named-package update with the bare update. Trace how npm resolves peer dependencies when package names are supplied to npm update --package-lock-only, then identify the relevant tests and add coverage for this lockfile-only case. Done means naming react succeeds and preserves the root pin at 18.3.1.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Environment
- npm 11.19.0, node v24.21.0, Linux x86_64
Steps to reproduce
Public repo storytold/artcraft at 1f969a9224934a55417daf10359a6fb1458b63f4, directory frontend/. The root package.json pins "react": "18.3.1" exactly. The workspace apps/artcraft depends on "react": "^18.2.0" and "@preact/signals-react": "^2.0.1", whose peer range is react@"^16.14.0 || 17.x || 18.x || 19.x".
git clone https://github.com/storytold/artcraft && cd artcraft/frontend
git checkout 1f969a9224934a55417daf10359a6fb1458b63f4
npm update --package-lock-only --ignore-scripts # exit 0
git checkout -- package-lock.json
npm update react --package-lock-only --ignore-scripts # exit 1, ERESOLVE
Expected
Naming react updates no more than a plain npm update does. The project's own react requirements are 18.3.1 (root) and ^18.2.0 (workspace), so the result should keep react 18.3.1, as plain npm update does without error.
Actual
npm error code ERESOLVE
npm error ERESOLVE could not resolve
npm error While resolving: @preact/[email protected]
npm error Found: [email protected]
npm error react@"18.3.1" from the root project
...
npm error Conflicting peer dependency: [email protected]
npm error peer react@"^16.14.0 || 17.x || 18.x || 19.x" from @preact/[email protected]
npm error apps/artcraft/node_modules/@preact/signals-react
With react named, npm appears to choose [email protected] (the latest the peer range allows) for the peer edge, then rejects it against the root's exact pin. Naming react-dom or @preact/signals-react alone succeeds.
Context
We name every declared registry package (npm update a b c ...) instead of running a bare npm update so that Git dependencies stay at their locked commits. That makes the named form the only one available to us when a lock has Git dependencies.
Found by an automated test of a dependency-update tool across public repositories.
- 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