On Windows, the detached spawn option creates a visible console window. Combined with npm (which is a .cmd batch file), this causes a brief window flash that steals focus from the user's terminal. - Remove detached: true (not needed, child.unref() handles non-blocking) - Add windowsHide: true to both spawn() and inner execSync()