<#503 No output due to EINVAL on Windows> Issue cr...
# pact-js-development
g
#503 No output due to EINVAL on Windows Issue created by timvahlbrock Thank you for reporting a bug! We appreciate it very much. Issues are a big input into the priorities for Pact development All italic text in this template is safe to remove before submitting Thanks again! Software versions Please provide at least OS and version of pact-js • OS: Win 11 • Pact Node version: 14.3.4 • Node Version: 20.12.2 • Other Versions: none Issue Checklist Please confirm the following: ☑︎ I have upgraded to the latest ☑︎ I have the read the FAQs in the Readme ☑︎ I have triple checked, that there are no unhandled promises in my code ☑︎ I have set my log level to debug and attached a log file showing the complete request/response cycle ☑︎ For bonus points and virtual high fives, I have created a reproduceable git repository (see below) to illustrate the problem Expected behaviour There is output on Windows. Actual behaviour There is no output on Windows. Steps to reproduce Have pact-js-core installed either locally or globally and run any command. There is no output, but calling the .bat files directly works fine. Debugging reveals that the child process spawn fails, with EINVAL. As described here Node no longer allows calling of .bat and .cmd files for security reasons. As the input to child process spawn in this project always is sanitized, the fix described in the mentioned Node CVE Report can be safely used to fix this. Relevant log files
Copy code
error: Error: spawnSync T:\he\path\to\my\project\node_modules\@pact-foundation\pact-core\standalone\windows-x64-2.4.2\pact\bin\pact-broker.bat EINVAL
      at Object.spawnSync (node:internal/child_process:1124:20)
      at Object.spawnSync (node:child_process:876:24)
      at Object.<anonymous> (T:\he\path\to\my\project\node_modules\@pact-foundation\pact-core\bin\pact-broker.js:9:29)
      at Module._compile (node:internal/modules/cjs/loader:1369:14)
      at Module._extensions..js (node:internal/modules/cjs/loader:1427:10)
      at Module.load (node:internal/modules/cjs/loader:1206:32)
      at Module._load (node:internal/modules/cjs/loader:1022:12)
      at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
      at node:internal/main/run_main_module:28:49
pact-foundation/pact-js-core
thankyou 1