Skip to content

Commit 83d6012

Browse files
authored
Revert "fix: spawn EINVAL on Windows with script-shell configured (#42)" (#44)
This reverts commit 823f08c.
1 parent 823f08c commit 83d6012

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

index.js

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -241,20 +241,6 @@ function runCmd_ (cmd, pkg, env, wd, opts, stage, unsafe, uid, gid, cb_) {
241241
conf.windowsVerbatimArguments = true
242242
}
243243

244-
// Spawning .bat and .cmd files on Windows requires the "shell" option to
245-
// spawn to be set. Otherwise spawn will throw with EINVAL.
246-
//
247-
// https://nodejs.org/api/child_process.html#spawning-bat-and-cmd-files-on-windows
248-
// https://nodejs.org/en/blog/vulnerability/april-2024-security-releases-2
249-
//
250-
// The shell option is security sensitive. It should make sense for this
251-
// usecase since scripts in package.json intentionally run on the shell.
252-
// Avoiding setting the shell option in all cases to preserve existing
253-
// behavior on non-Windows platforms.
254-
if (process.platform === 'win32' && customShell && (customShell.endsWith('.bat') || customShell.endsWith('.cmd'))) {
255-
conf.shell = true
256-
}
257-
258244
opts.log.verbose('lifecycle', logid(pkg, stage), 'PATH:', env[PATH])
259245
opts.log.verbose('lifecycle', logid(pkg, stage), 'CWD:', wd)
260246
opts.log.silly('lifecycle', logid(pkg, stage), 'Args:', [shFlag, cmd])

0 commit comments

Comments
 (0)