Open developerasun opened 2 years ago
Describe the bug
Node.js child_process spawn method not working in Windows10
To Reproduce Steps to reproduce the behavior:
"use strict"; const { spawn, exec } = require("child_process"); // The child_process.spawn() method spawns a new process using the givencommand, // with command-line arguments in args. // If omitted, args defaults to an empty array. // spawn(command, [cli-options]) const child = spawn("dir", []); child.stdout.addListener("data", (data) => { console.log("stdout: ", data); }); child.stderr.addListener("data", (data) => { console.log("stderr: ", data); }); child.addListener("error", (error) => { console.log(error.message); }); child.addListener("exit", (exitCode, signal) => { if (exitCode) console.log(exitCode); if (signal) console.log("process killed with signal: ", signal); console.log("done"); });
Expected behavior
spawn child process runs a dir command in terminal
Screenshots
Additional context Add any other context about the problem here.
Labeling Add a proper label for the issue
Describe the bug
Node.js child_process spawn method not working in Windows10
To Reproduce Steps to reproduce the behavior:
Expected behavior
spawn child process runs a dir command in terminal
Screenshots
Additional context Add any other context about the problem here.
Labeling Add a proper label for the issue