From 78ebe84b65619eed6c7db151bf276e0f9cad7306 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Cruz?= Date: Sun, 29 Nov 2026 04:26:26 +0000 Subject: [PATCH] docs: mention the DEP0190 warning when passing arguments with `options.shell` Node.js 24 and later warn when arguments are passed together with `shell: true`, which cross-spawn passes to Node's spawn as is. Closes #176 --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index ecd3aaa..5ace303 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,8 @@ When `options.shell` is used, all of `cross-spawn`'s enhancements are disabled. This mimics the Node.js behavior. More specifically, the command and its arguments will not be automatically escaped nor shebang support will be offered. This is by design because if you are using `options.shell` you are probably targeting a specific platform anyway and you don't want things to get into your way. +Since the arguments are passed to Node's `spawn` as is, Node.js 24 and later print a [DEP0190](https://nodejs.org/api/deprecations.html#DEP0190) deprecation warning when arguments are used together with `options.shell`, because they are only joined with spaces, not escaped. + On Windows, shell built-ins such as `dir` or `echo` aren't programs, so, like with Node's `spawn`, they need `shell: true`. ### Windows argument escaping