`npm update react --package-lock-only` fails with ERESOLVE where `npm update --package-lock-only` succeeds
メンテナーはふだん 2 日以内に返信
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 53/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- javascript, node.js
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- 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 日以内に返信
-
[workshop-sync] workshop/side-quest-26-01-forecast-costs.md: forecast default history window is inaccurate対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンdocumentation
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
githubnext/gh-aw-workshop#6332 ·
メンテナーはふだん 1 日以内に返信