Skip to content

child_process - windowsHide not working with detached: true #21825

Description

@affanshahid
  • Version: v10.6.0
  • Platform: Windows 10 64-bit
  • Subsystem: child_process

Running the following results in a command prompt popping up to run the command, and the output not being piped correctly.

const log = fs.openSync('./log.out', 'w');

const c = cp.spawn(
  'npm.cmd', 
  ['-g', 'ls', '--depth', '0'],
  {stdio: ['ignore', log, log], detached: true, shell: false, windowsHide: true}
);

Removing detached makes everything work just fine. But the command wont run if the parent dies, which is something I don't want in the actual scenario.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedIssues that need assistance from volunteers or PRs that need help to proceed.windowsIssues and PRs related to the Windows platform.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions