diff --git a/electron/app/ipc/export_handlers.ts b/electron/app/ipc/export_handlers.ts index 74f41231..da6910a3 100644 --- a/electron/app/ipc/export_handlers.ts +++ b/electron/app/ipc/export_handlers.ts @@ -54,11 +54,14 @@ export function setupExportHandlers() { NEXT_PUBLIC_URL: process.env.NEXT_PUBLIC_URL, NEXT_PUBLIC_FAST_API: process.env.NEXT_PUBLIC_FAST_API, }); - const exportTaskProcess = spawn("node", [exportScriptPath, exportTaskPath], { + // Use the current Electron binary in Node-compatible mode so export does + // not depend on a system-wide `node` being available in PATH. + const exportTaskProcess = spawn(process.execPath, [exportScriptPath, exportTaskPath], { stdio: ["ignore", "pipe", "pipe"], cwd: baseDir, env: { ...process.env, + ELECTRON_RUN_AS_NODE: "1", TEMP_DIRECTORY: tempDir, APP_DATA_DIRECTORY: appDataDir, NODE_ENV: "development",