I am able to restart my node script using this method, but it does not spawn a console window to view the output.
The shell option prevents the script from spawning when uncommented.
How can I spawn a second instance of my node.js script with a console window so I can view the output after my original script exits?
function restartScript()
{
process.on("exit", function ()
{
require("child_process").spawn(process.argv.shift(), process.argv.filter(x=> x !="-debugging"), {
cwd: process.cwd(),
detached: true,
// shell: true
});
});
process.exit();
}