[BUG] scripts/dependency-graph.js splits npm-cli-repos.txt on os.EOL, so DEPENDENCIES.md depends on the checkout's line endings
I maintainer di solito rispondono entro 2 giorni
@saruk-vedant ci sta già lavorando.
Dal 23/11/2026.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 82/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- javascript, node.js
- Ambito
- build-system, tooling
Direzione di ricerca
Inizia da scripts/dependency-graph.js, dove scripts/npm-cli-repos.txt viene suddiviso usando os.EOL, e leggi come scripts/resetdeps.js genera i file delle dipendenze. Riproduci il procedimento con input LF e CRLF, poi verifica che entrambe le esecuzioni lascino DEPENDENCIES.md e DEPENDENCIES.json corrispondenti ai file sottoposti a commit.
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
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
- 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] 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
-
[BUG] E401 error message does not use the configured registryForse già presa @toufiq-dev l’ha presa 66 giorni fa. ApertaBug Priority 3
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/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