From 7404fc2f1427eda2ab546c4fd071211e9af4f42a Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Wed, 9 May 2018 20:42:31 +0200 Subject: [PATCH 1/2] process: provide dummy stdio for non-console Windows apps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The only known condition where we could not provide appropriate stdio streams so far were non-console Windows applications. Since this issue has come up a few times in our issue tracker now, switch to providing dummy streams for these cases instead. If there are other valid cases in which `uv_guess_handle` fails, and where there is a more sensible way to provide stdio, we’ll probably still find out because the streams don’t work properly either way. Refs: https://github.com/nodejs/help/issues/1251 --- doc/api/errors.md | 36 +++++++++++++++++++------------ lib/internal/errors.js | 3 --- lib/internal/process/stdio.js | 28 ++++++++++++++++-------- test/parallel/test-dummy-stdio.js | 26 ++++++++++++++++++++++ 4 files changed, 67 insertions(+), 26 deletions(-) create mode 100644 test/parallel/test-dummy-stdio.js diff --git a/doc/api/errors.md b/doc/api/errors.md index 3b4ea6156f36dd..a766999e43d0fa 100644 --- a/doc/api/errors.md +++ b/doc/api/errors.md @@ -1795,20 +1795,6 @@ An attempt was made to load a module with an unknown or unsupported format. An invalid or unknown process signal was passed to an API expecting a valid signal (such as [`subprocess.kill()`][]). - -### ERR_UNKNOWN_STDIN_TYPE - -An attempt was made to launch a Node.js process with an unknown `stdin` file -type. This error is usually an indication of a bug within Node.js itself, -although it is possible for user code to trigger it. - - -### ERR_UNKNOWN_STREAM_TYPE - -An attempt was made to launch a Node.js process with an unknown `stdout` or -`stderr` file type. This error is usually an indication of a bug within Node.js -itself, although it is possible for user code to trigger it. - ### ERR_V8BREAKITERATOR @@ -2065,6 +2051,28 @@ kind of internal Node.js error that should not typically be triggered by user code. Instances of this error point to an internal bug within the Node.js binary itself. + +### ERR_UNKNOWN_STDIN_TYPE + + +An attempt was made to launch a Node.js process with an unknown `stdin` file +type. This error is usually an indication of a bug within Node.js itself, +although it is possible for user code to trigger it. + + +### ERR_UNKNOWN_STREAM_TYPE + + +An attempt was made to launch a Node.js process with an unknown `stdout` or +`stderr` file type. This error is usually an indication of a bug within Node.js +itself, although it is possible for user code to trigger it. + ### ERR_VALUE_OUT_OF_RANGE