[BUG] scripts/dependency-graph.js splits npm-cli-repos.txt on os.EOL, so DEPENDENCIES.md depends on the checkout's line endings
Los mantenedores suelen responder en 2 días
@saruk-vedant ya está trabajando en esto.
Desde el 23/11/2026.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 82/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- javascript, node.js
- Área
- build-system, tooling
Línea de trabajo
Empieza por scripts/dependency-graph.js, donde scripts/npm-cli-repos.txt se divide usando os.EOL, y lee cómo scripts/resetdeps.js genera los archivos de dependencias. Reproduce el proceso con entradas LF y CRLF y comprueba después que ambas ejecuciones dejan DEPENDENCIES.md y DEPENDENCIES.json tal como están en el commit.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- JavaScript
- Estrellas
- 10.3k
- Forks
- 5k
- Merge medio
- 4 d 11 h
- PR fusionados (30 d)
- 26
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de npm/cli
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 2 días
-
[BUG] npm pkg delete removes the first array item for a nonexistent propertyPosiblemente ocupada @drawliin la tomó hace 42 días. Abiertocmd:delete Priority 3
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
Los mantenedores suelen responder en 2 días
-
create node pr: Node.js 20 deprecation & `DEP0040` warnings loggedQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. AbiertoEngineering Priority 1
Dificultad 1/5 Menos de una hora Aptitud para principiantes 80/100
Los mantenedores suelen responder en 2 días
-
`npm audit signatures` does not report how many packages it skipped for want of registry keysPosiblemente ocupada @greenlincoln05 la tomó hace 63 días. AbiertoPriority 3
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
npm/cli#10018 · 2 comentarios ·
Los mantenedores suelen responder en 2 días
-
[BUG] E401 error message does not use the configured registryPosiblemente ocupada @toufiq-dev la tomó hace 66 días. AbiertoBug Priority 3
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
npm/cli#10014 · 1 comentario ·
Los mantenedores suelen responder en 2 días
Issues similares
-
docs: add SECURITY.md vulnerability reporting policyPosiblemente ocupada @AK-Lmn la tomó hoy. Abierto
Dificultad 1/5 1-3 horas Aptitud para principiantes 72/100
flisk-sh/linux2wasm#12 ·
Los mantenedores suelen responder en 1 día
-
possible bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Mintplex-Labs/anything-llm#7388 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 60/100
Los mantenedores suelen responder en 1 día
-
v6: Minified bootstrap.min.css is missing header infoPosiblemente ocupada @lazerg la tomó hoy. Abiertobug build confirmed has-pr v6
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
documentation
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
githubnext/gh-aw-workshop#6332 ·
Los mantenedores suelen responder en 1 día