-
Notifications
You must be signed in to change notification settings - Fork 31.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unexpected behavior for execSync #54649
Comments
Have you tried adding Also, can you reproduce in the latest version of the release line? |
i tried |
CC @nodejs/platform-windows @nodejs/child_process |
Fixes: nodejs#54649 Refs: nodejs#54293 Co-authored-by: Zanette Arrigo <arrigo.zanette@m31.com>
I tried to reproduce it locally, but saw at least one log in the terminal. It also throws an exception which you can catch and print the error message in the parent process in both cases. Do you think this should be investigated further? If so, could you provide a full example of your code that generates an error?
|
Since the last comment was unanswered for 2 months, I'll close this issue. Feel free to reopen if needed. |
Version
20.11.0
Platform
Subsystem
Child process
What steps will reproduce the bug?
execSync('net session', {windowsHide: true, stdio: ['ignore', 'ignore', 'pipe']});
should printstderr
but it does not. as said in the documentationpipe
is the default so changingstdio
topipe
should not change anything but it stopsstderr
from printing, however do note it still throws the exceptionthis behavior is also present with
['pipe', 'pipe', 'pipe']
or any other variantHow often does it reproduce? Is there a required condition?
100% of the time. none as far as i know
What is the expected behavior? Why is that the expected behavior?
to print out
stderr
like it's supposed to, if you dont touchstdio
it printsstderr
but if you change it topipe
which is the default it dosent printstderr
anymore, i do not know if it happens withstdin
orstdout
What do you see instead?
nothing, explained above
Additional information
please do not forget about this:
there should be an option to not print the
stderr
but still keep the thrown exception detailed. if you set it toignore
it does still say "command failed" in the exception but dosent provide the information it normally provides if you set it topipe
(well in case thepipe
option actually works as expected(like if you dont changestdio
in the first place which is what the issue is for))e.g.
the exception without any
stdio
options:with
ignore
:PS this is my first issue so please forgive me for any issues
The text was updated successfully, but these errors were encountered: