You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6-5Lines changed: 6 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -30,10 +30,10 @@ Node has issues when using spawn on Windows:
30
30
31
31
- It ignores [PATHEXT](https://github.com/joyent/node/issues/2318)
32
32
- It does not support [shebangs](https://en.wikipedia.org/wiki/Shebang_(Unix))
33
-
- No `options.shell` support on node `<v4.8`
34
33
- Has problems running commands with [spaces](https://github.com/nodejs/node/issues/7367)
35
-
- Has problems running commands with posix relative paths (e.g.: `my-folder/my-executable`)
36
-
- Circuvents an [issue](https://github.com/moxystudio/node-cross-spawn/issues/82) around command shims (files in node_modules/.bin/), where arguments with quotes and parenthesis would result in an [invalid syntax error](https://github.com/moxystudio/node-cross-spawn/blob/e77b8f22a416db46b6196767bcd35601d7e11d54/test/index.test.js#L149)
34
+
- Has problems running commands with posix relative paths (e.g.: `./my-folder/my-executable`)
35
+
- Circuvents an [issue](https://github.com/moxystudio/node-cross-spawn/issues/82) around command shims (files in `node_modules/.bin/`), where arguments with quotes and parenthesis would result in an [invalid syntax error](https://github.com/moxystudio/node-cross-spawn/blob/e77b8f22a416db46b6196767bcd35601d7e11d54/test/index.test.js#L149)
36
+
- No `options.shell` support on node `<v4.8`
37
37
38
38
All these issues are handled correctly by `cross-spawn`.
39
39
There are some known modules, such as [win-spawn](https://github.com/ForbesLindesay/win-spawn), that try to solve this but they are either broken or provide faulty escaping of shell arguments.
### Using `options.shell` as an alternative to `cross-spawn`
61
61
62
-
Starting from node `v4.8`, `spawn` has a `shell` option that allows you run commands from within a shell. This new option solves most of the problems that `cross-spawn` attempts to solve, but:
62
+
Starting from node `v4.8`, `spawn` has a `shell` option that allows you run commands from within a shell. This new option solves
63
+
the [PATHEXT](https://github.com/joyent/node/issues/2318) issue but:
63
64
64
65
- It's not supported in node `<v4.8`
65
66
- You must manually escape the command and arguments which is very error prone, specially when passing user input
66
-
-It just solves the [PATHEXT](https://github.com/joyent/node/issues/2318) issue from the [Why](#why) section
67
+
-There are a lot of other unresolved issues from the [Why](#why) section that you must take into account
67
68
68
69
If you are using the `shell` option to spawn a command in a cross platform way, consider using `cross-spawn` instead. You have been warned.
0 commit comments