问题
Below code starts Electron application, however, console.log()
from the main process will not be available.
import executeExternalCommand, { ExecaReturnValue } from 'execa';
async startInitializeProjectGUI(): Promise<void> {
const executionResult: ExecaReturnValue<string> = await executeExternalCommand(
'electron',
['InitializeProject_GUI.js'], // console.log() is here
{ cwd: __dirname }
);
if (executionResult.failed) {
Promise.reject(new Error('Can not start "electron"'));
}
return;
}
How can I get console output of child process with execa?
来源:https://stackoverflow.com/questions/56539690/how-to-get-console-log-output-from-the-child-process-in-execa