Skip to content

Commit c6715ca

Browse files
committed
doc: deprecate passing an empty string to options.shell
1 parent 22685b8 commit c6715ca

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
@@ -3988,6 +3988,30 @@ Instantiating classes without the `new` qualifier exported by the `node:http` mo
39883988
It is recommended to use the `new` qualifier instead. This applies to all http classes, such as
39893989
`OutgoingMessage`, `IncomingMessage`, `ServerResponse` and `ClientRequest`.
39903990

3991+
### DEP0196: Calling `node:child_process` functions with `options.shell` as an empty string
3992+
3993+
<!-- YAML
3994+
changes:
3995+
- version: REPLACEME
3996+
pr-url: https://github.com/nodejs/node/pull/TODO
3997+
description: Documentation-only deprecation.
3998+
-->
3999+
4000+
Type: Documentation-only
4001+
4002+
Calling the process-spawning functions with `{ shell: '' }` is almost certainly
4003+
unintentional, and can cause aberrant behavior.
4004+
4005+
To make [`child_process.execFile`][] or [`child_process.spawn`][] invoke the
4006+
default shell, use `{ shell: true }`. If the intention is not to invoke a shell
4007+
(default behavior), either omit the `shell` option, or set it to `false` or a
4008+
nullish value.
4009+
4010+
To make [`child_process.exec`][] invoke the default shell, either omit the
4011+
`shell` option, or set it to a nullish value. If the intention is not to invoke
4012+
a shell, use [`child_process.execFile`][] instead.
4013+
4014+
39914015
[DEP0142]: #dep0142-repl_builtinlibs
39924016
[NIST SP 800-38D]: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf
39934017
[RFC 6066]: https://tools.ietf.org/html/rfc6066#section-3

0 commit comments

Comments
 (0)