Use npm as fallback if pnpm isn't available & more robust pnpm installation

This commit is contained in:
Will Chen
2025-04-18 21:43:46 -07:00
parent 14d09f080f
commit 7ac07aa0ce
2 changed files with 11 additions and 7 deletions

View File

@@ -65,12 +65,16 @@ async function executeAppLocalNode({
appId: number;
event: Electron.IpcMainInvokeEvent;
}): Promise<void> {
const process = spawn("pnpm install && pnpm run dev --port 32100", [], {
cwd: appPath,
shell: true,
stdio: "pipe", // Ensure stdio is piped so we can capture output/errors and detect close
detached: false, // Ensure child process is attached to the main process lifecycle unless explicitly backgrounded
});
const process = spawn(
"(pnpm install && pnpm run dev --port 32100) || (npm install && npm run dev -- --port 32100)",
[],
{
cwd: appPath,
shell: true,
stdio: "pipe", // Ensure stdio is piped so we can capture output/errors and detect close
detached: false, // Ensure child process is attached to the main process lifecycle unless explicitly backgrounded
}
);
// Check if process spawned correctly
if (!process.pid) {