fix(scripts): stryker-diff.mjs spawns the extensionless .bin shim and cannot run on Windows

Abierto Apto para principiantes
#2,514 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 3 días

@easonLiangWorldedtech ya está trabajando en esto.

Desde el 13/11/2026.

  • #2450 de @easonLiangWorldedtech — abierto

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
78/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
node.js, typescript

Línea de trabajo

Lee scripts/stryker-diff.mjs alrededor de la línea 412 e inspecciona cómo inicia el binario de Stryker. Comprueba las entradas de node_modules/.bin del paquete y compara cómo gestiona el script Windows y POSIX. Se considera terminado cuando la comprobación previa local de mutación puede iniciar Stryker en Windows y sigue funcionando en Linux.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Symptom

node scripts/stryker-diff.mjs cannot start Stryker on Windows: spawnSync ... ENOENT for node_modules\.bin\stryker, even though the file exists and stryker --version reports 10.0.0. The local preflight described in the mutation-gate protocol therefore only works on Linux, and every Windows contributor has to fall back to CI for the changed-line mutation report.

Cause

scripts/stryker-diff.mjs:421 passes the extensionless POSIX shim straight to spawnSync - no shell, no process.platform branch - and the sibling call at line 373 does the same for vitest. The installed set is stryker, stryker.CMD, stryker.ps1 (measured at main 410e5ad3d5, blob 7dfe0006d2d5, unchanged since a15ba8c8); only the latter two are runnable.

Expected

Do not branch on the suffix: spawning node_modules\.bin\stryker.CMD without a shell was probed and returns EINVAL (-4071), where the extensionless shim returns ENOENT (-4058). Resolve the entry the owning package declares - @stryker-mutator/core ships bin: {"stryker": "./bin/stryker.js"} - and run that file through process.execPath: status 0 with 10.0.0 in 1000 ms; vitest's declared vitest.mjs starts in 64 ms the same way. #2450 implements exactly that for both calls.

Workaround meanwhile

Run the gate's Stryker step through cmd /c node_modules\.bin\stryker.CMD with the six STRYKER_* variables the script already sets, and keep reading the CI mutation-diff run as the authority.

Lenguaje dominante
TypeScript
Estrellas
2k
Forks
301
Merge medio
3 d 14 h
PR fusionados (30 d)
103

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Zoo-Code-Org/Zoo-Code

Todos los issues de Zoo-Code-Org/Zoo-Code

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.