Closed fgamador closed 1 month ago
This may also fix #357.
I was able to reproduce after upgrading my node version which was on 18.16.
Here is a limited patch that gets much working, but there are other usages of child processes that may want coverage (quake/aqua/weddell).
Furthermore, we likely want to test on windows and only optionally add this based on platform.
Elevating priority since this totally breaks all our build tooling on windows after node upgrade.
@samreid investigated and were able to trace it down to runnables that were not binaries (like bash scripts). For example grunt
and npx
. This helped us target exactly when we need the shell:true
workaround. @fgamador, can you please check to see if this is fixed for you on main?
Yup, that fixes it. Thanks!
Excellent! I appreciate your quick response. Please do let us know if you run into anything else. We definitely want to continue improving our open source experience.
When using a recent version of Node on Windows, 'grunt create-sim' fails with "Error: spawn EINVAL". I found that this is a known issue with recent versions of Node and can be fixed by adding
shell: true
to the options passed tochild_process.spawn
in perennial/js/common/execute.js (line 52). I tried it, and it works.C:\Users\franz\Dev\NodeProjects\phetsims\perennial (main -> origin) (perennial@0.0.0) λ grunt create-sim --repo=my-first-sim --author="Franz Amador" Running "create-sim" task Greetings Franz Amador! creating sim with repository name my-first-sim wrote ../my-first-sim/.gitignore [...] wrote ../my-first-sim/tsconfig.json info: npm update in ../my-first-sim Fatal error: Perennial task failed: Error: spawn EINVAL at ChildProcess.spawn (node:internal/child_process:421:11) at Object.spawn (node:child_process:761:9) at C:\Users\franz\Dev\NodeProjects\phetsims\perennial\js\common\execute.js:52:40 at new Promise () at module.exports (C:\Users\franz\Dev\NodeProjects\phetsims\perennial\js\common\execute.js:45:10) at C:\Users\franz\Dev\NodeProjects\phetsims\perennial\js\common\npmUpdateDirectory.js:28:11 at C:\Users\franz\Dev\NodeProjects\phetsims\perennial\node_modules\async-mutex\lib\Mutex.js:23:66 at Semaphore. (C:\Users\franz\Dev\NodeProjects\phetsims\perennial\node_modules\async-mutex\lib\Semaphore.js:37:46) at step (C:\Users\franz\Dev\NodeProjects\phetsims\perennial\node_modules\tslib\tslib.js:195:27) at Object.next (C:\Users\franz\Dev\NodeProjects\phetsims\perennial\node_modules\tslib\tslib.js:176:57) Full Error details: Error: spawn EINVAL