Skip to content

Commit c6aee09

Browse files
aduh95Renegade334
andauthored
doc: deprecate passing an empty string to options.shell
Co-authored-by: Renegade334 <contact.9a5d6388@renegade334.me.uk> PR-URL: #58564 Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 516b4eb commit c6aee09

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

doc/api/deprecations.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3990,6 +3990,29 @@ Instantiating classes without the `new` qualifier exported by the `node:http` mo
39903990
It is recommended to use the `new` qualifier instead. This applies to all http classes, such as
39913991
`OutgoingMessage`, `IncomingMessage`, `ServerResponse` and `ClientRequest`.
39923992

3993+
### DEP0196: Calling `node:child_process` functions with `options.shell` as an empty string
3994+
3995+
<!-- YAML
3996+
changes:
3997+
- version: REPLACEME
3998+
pr-url: https://github.com/nodejs/node/pull/58564
3999+
description: Documentation-only deprecation.
4000+
-->
4001+
4002+
Type: Documentation-only
4003+
4004+
Calling the process-spawning functions with `{ shell: '' }` is almost certainly
4005+
unintentional, and can cause aberrant behavior.
4006+
4007+
To make [`child_process.execFile`][] or [`child_process.spawn`][] invoke the
4008+
default shell, use `{ shell: true }`. If the intention is not to invoke a shell
4009+
(default behavior), either omit the `shell` option, or set it to `false` or a
4010+
nullish value.
4011+
4012+
To make [`child_process.exec`][] invoke the default shell, either omit the
4013+
`shell` option, or set it to a nullish value. If the intention is not to invoke
4014+
a shell, use [`child_process.execFile`][] instead.
4015+
39934016
[DEP0142]: #dep0142-repl_builtinlibs
39944017
[NIST SP 800-38D]: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf
39954018
[RFC 6066]: https://tools.ietf.org/html/rfc6066#section-3
@@ -4018,6 +4041,7 @@ It is recommended to use the `new` qualifier instead. This applies to all http c
40184041
[`asyncResource.runInAsyncScope()`]: async_context.md#asyncresourceruninasyncscopefn-thisarg-args
40194042
[`buffer.subarray`]: buffer.md#bufsubarraystart-end
40204043
[`child_process.execFile`]: child_process.md#child_processexecfilefile-args-options-callback
4044+
[`child_process.exec`]: child_process.md#child_processexeccommand-options-callback
40214045
[`child_process.spawn`]: child_process.md#child_processspawncommand-args-options
40224046
[`child_process`]: child_process.md
40234047
[`clearInterval()`]: timers.md#clearintervaltimeout

0 commit comments

Comments
 (0)