Skip to content

doc: remove spawn with shell example from bat/cmd section#62243

Open
kovan wants to merge 5 commits intonodejs:mainfrom
kovan:doc/bat-cmd-spawn-deprecation
Open

doc: remove spawn with shell example from bat/cmd section#62243
kovan wants to merge 5 commits intonodejs:mainfrom
kovan:doc/bat-cmd-spawn-deprecation

Conversation

@kovan
Copy link
Contributor

@kovan kovan commented Mar 13, 2026

Remove the suggestion to use child_process.spawn() with the shell
option for running .bat and .cmd files on Windows. Passing arguments
through spawn with shell: true is deprecated (DEP0190) due to
shell injection risks. The exec() and direct cmd.exe spawn
alternatives remain documented.

Continues the work from #58739 which addressed the same issue but
stale-closed without review.

Fixes: #58735

Remove the suggestion to use child_process.spawn() with the shell
option set for running .bat and .cmd files on Windows. Passing
arguments through spawn with shell: true is deprecated (DEP0190)
due to shell injection risks. Keep the exec() and direct cmd.exe
spawn alternatives.

Fixes: nodejs#58735
@nodejs-github-bot nodejs-github-bot added child_process Issues and PRs related to the child_process subsystem. doc Issues and PRs related to the documentations. labels Mar 13, 2026
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
kovan added 2 commits March 18, 2026 15:55
Apply remaining review suggestions from aduh95:
- Add spawn+shell back to the list with (not recommended, see DEP0190)
- Fix DEP0190 link reference to use full anchor
@aduh95
Copy link
Contributor

aduh95 commented Mar 18, 2026

Fix DEP0190 link reference to use full anchor

Why?

@kovan
Copy link
Contributor Author

kovan commented Mar 18, 2026

Fixed, reverted to the short anchor you suggested. Sorry about that.

@aduh95 aduh95 added commit-queue Add this label to land a pull request using GitHub Actions. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. author ready PRs that have at least one approval, no pending requests for changes, and a CI started. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. child_process Issues and PRs related to the child_process subsystem. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. doc Issues and PRs related to the documentations.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Conflict between child_process API guidance and DEP0190

3 participants