From fd70d8de7a7a6ea0a58484f90dce249624dc289f Mon Sep 17 00:00:00 2001 From: sudipnext Date: Fri, 20 Mar 2026 13:32:02 +0545 Subject: [PATCH] Use Electron binary for export task to avoid system-wide node dependency --- electron/app/ipc/export_handlers.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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",