Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

234
Views
How can I restart a node script with a console window?

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();
}
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!