From cfd00d4b9fa68489e59f0d30beef5094f724a21a Mon Sep 17 00:00:00 2001 From: rookiestar28 <151893693+rookiestar28@users.noreply.github.com> Date: Fri, 6 Feb 2026 00:20:47 +0800 Subject: [PATCH] --amend --- pyproject.toml | 2 +- scripts/run-playwright.mjs | 19 ++++++++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 3d5b899..eea6bc7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "comfyui-openclaw" description = "Your own personal AIGC Factory. Any picture. Any reel. The Comfy way.©️" -version = "0.1.0" +version = "0.1.1" license = {text = "MIT"} readme = "README.md" requires-python = ">=3.10" diff --git a/scripts/run-playwright.mjs b/scripts/run-playwright.mjs index 3cac96b..2ab31cd 100644 --- a/scripts/run-playwright.mjs +++ b/scripts/run-playwright.mjs @@ -39,11 +39,24 @@ function ensurePythonShimIfNeeded(env) { return env; } +function runNpmExec(args, { label }) { + if (process.env.npm_execpath) { + const res = spawnSync(process.execPath, [process.env.npm_execpath, 'exec', '--', ...args], { + stdio: 'inherit', + env, + }); + return res; + } + return spawnSync('npm', ['exec', '--', ...args], { stdio: 'inherit', env }); +} + function runPlaywrightCommand(args, { label }) { if (process.platform === 'win32') { - const res = spawnSync('npm', ['exec', '--', ...args], { stdio: 'inherit', env }); + const res = runNpmExec(args, { label }); if (res.error && res.error.code === 'ENOENT') { - console.error(`[OpenClaw] Failed to run ${label}: npm not found in PATH`); + console.error( + `[OpenClaw] Failed to run ${label}: npm not found in PATH (and npm_execpath not set)`, + ); process.exit(1); } return res; @@ -51,7 +64,7 @@ function runPlaywrightCommand(args, { label }) { const res = spawnSync(getNpxCommand(), args, { stdio: 'inherit', env }); if (res.error && res.error.code === 'ENOENT') { - const fallback = spawnSync('npm', ['exec', '--', ...args], { stdio: 'inherit', env }); + const fallback = runNpmExec(args, { label }); if (fallback.error) { console.error(`[OpenClaw] Failed to run ${label}:`, fallback.error); process.exit(1);