[BUG] scripts/dependency-graph.js splits npm-cli-repos.txt on os.EOL, so DEPENDENCIES.md depends on the checkout's line endings
メンテナーはふだん 2 日以内に返信
@saruk-vedant がすでに取り組んでいます。
2026年11月23日 から。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 82/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- javascript, node.js
- 領域
- build-system, tooling
調査の方向性
scripts/dependency-graph.jsから始め、scripts/npm-cli-repos.txtがos.EOLを使って分割される箇所を確認し、scripts/resetdeps.jsが依存関係ファイルを生成する方法を読んでください。LFとCRLFの入力で再現し、その後、どちらの実行でもDEPENDENCIES.mdとDEPENDENCIES.jsonがコミット済みのファイルと一致したままであることを確認してください。
索引モデルが 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
On Windows, in a clone whose scripts/npm-cli-repos.txt has LF endings, node ./scripts/resetdeps.js leaves DEPENDENCIES.md and DEPENDENCIES.json modified: 139 lines are removed from DEPENDENCIES.md, among them edges between npm's own packages such as bin-links-->cmd-shim and cacache-->ssri. On Linux the same happens with the file in CRLF.
The file is split on os.EOL: https://github.com/npm/cli/blob/787f1520fa412e91a5792468f1c7f25b166867a6/scripts/dependency-graph.js#L12
Expected Behavior
DEPENDENCIES.md and DEPENDENCIES.json come out as committed whichever line endings scripts/npm-cli-repos.txt has, as they already do when its endings match os.EOL.
Steps To Reproduce
Steps to reproduce, on Windows:
- Clone npm/cli with LF line endings:
git clone --branch latest -c core.autocrlf=input https://github.com/npm/cli.git, thencd cli. node ./scripts/resetdeps.jsgit diff --stat
Actual result: step 3 lists DEPENDENCIES.md and DEPENDENCIES.json as modified.
Expected result: step 3 lists nothing.
Reproducer: https://gist.github.com/YevheniiKotyrlo/0ac725143c5278c8c30925c41986905b — bash repro.sh (Git Bash on Windows, or Linux) clones latest, runs node ./scripts/resetdeps.js, then node . run dependencies with scripts/npm-cli-repos.txt written in LF and in CRLF, and compares both files with the committed ones, line endings aside. It exits 1 while the two runs give different files, 0 once both match the committed ones.
Its output on Windows 11:
$ git clone --depth 1 --branch latest https://github.com/npm/cli.git
npm/cli 787f152 (npm 12.2.3), node v26.12.1, win32 10.0.26300, os.EOL "\r\n"
$ node ./scripts/resetdeps.js
$ node . run dependencies --ignore-scripts # scripts/npm-cli-repos.txt in LF
DEPENDENCIES.md: 139 lines removed, 6 added
DEPENDENCIES.json: 52 lines removed, 12 added
$ node . run dependencies --ignore-scripts # scripts/npm-cli-repos.txt in CRLF
DEPENDENCIES.md: as committed
DEPENDENCIES.json: as committed
edges missing from DEPENDENCIES.md with LF, among them:
< bin-links-->cmd-shim;
< cacache-->ssri;
RESULT: DEPENDENCIES.md DEPENDENCIES.json differ between scripts/npm-cli-repos.txt in LF and in CRLF
On Linux (Docker node:26):
$ git clone --depth 1 --branch latest https://github.com/npm/cli.git
npm/cli 787f152 (npm 12.2.3), node v26.13.1, linux 6.18.58.1-microsoft-standard-WSL2, os.EOL "\n"
$ node ./scripts/resetdeps.js
$ node . run dependencies --ignore-scripts # scripts/npm-cli-repos.txt in LF
DEPENDENCIES.md: as committed
DEPENDENCIES.json: as committed
$ node . run dependencies --ignore-scripts # scripts/npm-cli-repos.txt in CRLF
DEPENDENCIES.md: 139 lines removed, 6 added
DEPENDENCIES.json: 52 lines removed, 12 added
edges missing from DEPENDENCIES.md with CRLF, among them:
< bin-links-->cmd-shim;
< cacache-->ssri;
RESULT: DEPENDENCIES.md DEPENDENCIES.json differ between scripts/npm-cli-repos.txt in LF and in CRLF
Environment
- npm: 12.2.3 (npm/cli
latestat 787f152) - Node.js: v26.12.1
- OS Name: Windows 11 Pro (win32 10.0.26300)
- System Model Name: custom-built x64 desktop
- npm config:
; "project" config from <clone>/.npmrc
package-lock = true
; "env" config from environment
cache = "<npm cache folder>"
userconfig = "<an empty file>"
; node version = v26.12.1
; npm version = 12.2.3
- 主要言語
- 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] 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 日以内に返信
-
[BUG] E401 error message does not use the configured registry対応中かも @toufiq-dev が 66 日前に担当しました。 オープンBug Priority 3
難易度 2/5 1〜3時間 初心者へのやさしさ 75/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 日以内に返信