Use npm as fallback if pnpm isn't available & more robust pnpm installation
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user