istanbuljs / nyc

the Istanbul command line interface
https://istanbul.js.org/
ISC License
5.55k stars 353 forks source link

spawn-wrap breaks nested npm run-script on windows #1474

Open MichaelBelousov opened 2 years ago

MichaelBelousov commented 2 years ago

Link to bug demonstration repository

https://github.com/MichaelBelousov/nyc-nested-npm-windows

cd nyc-nested-npm-windows
npm install
npm run test

Expected Behavior

The npm package script runs on windows

Observed Behavior

It doesn't, instead an error of The filename, directory name, or volume label syntax is incorrect. is printed. This is a result of some internal maybe native node code using options "munged" by the spawn-wrap package, but I couldn't identify any weird paths when diffing the munged and original options

Troubleshooting steps

Environment Information

  System:
    OS: Windows 10 10.0.19042
    CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
    Memory: 14.53 GB / 31.81 GB
  Binaries:
    Node: 14.18.2 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.17 - C:\Program Files\nodejs\yarn.CMD
    npm: 8.3.0 - C:\Program Files\nodejs\npm.CMD
  npmPackages:
    nyc: ^15.1.0 => 15.1.0