When spawning a new child in nodejs on windows (child_process.spawn
) it always opens a blank console window which stays open until the child process ends.
Is there a way to avoid this?
i.e. we want to run our application as a background service using forever
. However, it is not very backgroundy since it keeps opening and closing blank console windows...
EDIT: Making the sub application run in "quiet" mode is not an option since parts of the processes being spawned is wmic
.
spawn
and I never get a separate window on windows. Thjo i have listeneras setup forstdout
andstderr
. maybe thats the reason (i am not sure)... but I guess it depends on what are you invoking in your spawn. – Objurgateexec
. – Marielamarielestdout
andstderr
fordata
? I am talking aboutspawn
. – Objurgatecluster
? – DisenthrallwindowsHide <boolean>
: "Hide the subprocess console window that would normally be created on Windows systems. Default: false." – ShowwindowsHide
won't work with the optiondetached: true
because of this bug github.com/nodejs/node/issues/21825 – Newfeld