fix windows bug

This commit is contained in:
Chris Tate
2026-01-12 10:12:33 -06:00
parent 574037080c
commit 8b94bc35e0
2 changed files with 15 additions and 2 deletions
+6 -2
View File
@@ -206,8 +206,12 @@ pub fn ensure_daemon(session: &str, headed: bool) -> Result<(), String> {
{
use std::os::windows::process::CommandExt;
let mut cmd = Command::new("node");
cmd.arg(daemon_path)
// On Windows, use cmd.exe to run node to ensure proper PATH resolution
// This handles cases where node.exe isn't directly in PATH but node.cmd is
let mut cmd = Command::new("cmd");
cmd.arg("/c")
.arg("node")
.arg(daemon_path)
.env("AGENT_BROWSER_DAEMON", "1")
.env("AGENT_BROWSER_SESSION", session);
+9
View File
@@ -128,6 +128,15 @@ pub fn run_install(with_deps: bool) {
}
println!("\x1b[36mInstalling Chromium browser...\x1b[0m");
// On Windows, we need to use cmd.exe to run npx because npx is actually npx.cmd
// and Command::new() doesn't resolve .cmd files the way the shell does
#[cfg(windows)]
let status = Command::new("cmd")
.args(["/c", "npx", "playwright", "install", "chromium"])
.status();
#[cfg(not(windows))]
let status = Command::new("npx")
.args(["playwright", "install", "chromium"])
.status();