Skip to content

Commit

Permalink
Merge pull request #1793 from serverless-heaven/fix/spawn-einval-node…
Browse files Browse the repository at this point in the history
…-windows-error
  • Loading branch information
j0k3r authored May 17, 2024
2 parents 3ef76c2 + 6712aea commit 1762655
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,12 @@ class SpawnError extends Error {
*/
function spawnProcess(command, args, options) {
return new BbPromise((resolve, reject) => {
const child = childProcess.spawn(command, args, options);
const child = childProcess.spawn(command, args, {
...options,
// nodejs 20 on windows doesn't allow `.cmd` command to run without `shell: true`
// https://github.com/serverless-heaven/serverless-webpack/issues/1791
shell: /^win/.test(process.platform)
});
let stdout = '';
let stderr = '';
// Configure stream encodings
Expand Down

0 comments on commit 1762655

Please sign in to comment.