Skip to content

execSync no output #40360

@steven94kr

Description

@steven94kr

Version

v14.17.6

Platform

Linux steven-ubuntu 5.11.0-37-generic #41~20.04.2-Ubuntu SMP Fri Sep 24 09:06:38 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Subsystem

No response

What steps will reproduce the bug?

const root = require("child_process")
    .execSync("node -v")
    .toString();

console.log(root);

I expected the output is the v14.17.6, but I got nothing.

  const root = require("child_process")
    .execSync("node -v", {stdio:"inherit"})

In this case, I got the output in console.

It is so strange...
Can anyone help me?
I tried to search, about this case. But I can't get any helpful information.

How often does it reproduce? Is there a required condition?

No response

What is the expected behavior?

No response

What do you see instead?

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    child_processIssues and PRs related to the child_process subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions