Skip to content

fix(install.ps1): camoufox-cli 用 .cmd shim 替代 npm install -g + plugins list stderr - #457

Merged
bigbrother666sh merged 1 commit into
TeamWiseFlow:masterfrom
bigbrother666sh:fix/win-camoufox-shim-and-plugins-list-stderr
Jul 22, 2026
Merged

fix(install.ps1): camoufox-cli 用 .cmd shim 替代 npm install -g + plugins list stderr#457
bigbrother666sh merged 1 commit into
TeamWiseFlow:masterfrom
bigbrother666sh:fix/win-camoufox-shim-and-plugins-list-stderr

Conversation

@bigbrother666sh

Copy link
Copy Markdown
Member

两个 Win 实测卡点(v5.6.0,Administrator 用户):

1. camoufox-cli 全局装 EEXIST

npm error code EEXIST
npm error path C:\Users\Administrator\xiaobei\camoufox-cli
npm error EEXIST: file already exists

根因npm install -g $fork 在 Windows 上把 fork 装进 $prefix\node_modules 时撞 fork 源目录本身。Windows npm 不能像 Linux/mac 那样 symlink 到源目录(EEXIST on the fork dir)。

修法:仿 openclaw.cmd$Root\bin\camoufox-cli.cmd shim 直接跑 node $fork\dist\cli.js(fork 的 node_modules 已就位,Node 从 cli.js 向上解析依赖;camoufox-cli JS 用 __dirname 定位包根,行为与全局装一致)。前置 $Root\bin 进 PATH 让后续 camoufox-cli install 找得到 shim。去掉 npm_config_prefixnpm install -g

2. plugins list stderr NativeCommandError

openclaw.cmd : [state-migrations] Legacy state migration warnings:
+ $listOut = (& $ClawCmd plugins list 2>$null | Out-String)
+ FullyQualifiedErrorId : NativeCommandError

根因2>$null 在 Windows PowerShell 5.1 + Stop 下压不住 .cmd 的 stderr,仍抛 NativeCommandError([[34-win-install-ps1-stderr-stop-gotcha]] 同类坑)。

修法:加 Capture-Streamed helper(临时 Continue + 2>&1 + Out-String)替换。

验证

install.ps1 走 raw URL 拉取(irm raw.githubusercontent.com/.../master/scripts/install.ps1 | iex),合 master 即生效,无需重建 tarball。Auto Release 已禁用,合此 PR 不 bump 版本,保持 v5.6.0。

…s list stderr

两个 Win 实测卡点:

1. camoufox-cli 全局装 EEXIST:npm install -g $fork 在 Windows 上把 fork 装进
   $prefix\node_modules 时撞 fork 源目录本身(EEXIST: file already exists
   $Root\camoufox-cli)——Windows npm 不能像 Linux 那样 symlink 到源目录。
   改仿 openclaw.cmd 写 $Root\bin\camoufox-cli.cmd shim 直接跑
   node $fork\dist\cli.js(fork 的 node_modules 已就位,Node 从 cli.js 向上
   解析依赖;camoufox-cli JS 用 __dirname 定位包根,行为与全局装一致)。
   前置 $Root\bin 进 PATH 让 camoufox-cli install 找得到 shim。

2. plugins list stderr:(& $ClawCmd plugins list 2>$null | Out-String) 在
   Windows PowerShell 5.1 + Stop 下压不住 .cmd 的 stderr 仍抛 NativeCommandError。
   加 Capture-Streamed helper(Continue + 2>&1 + Out-String)替换。
@bigbrother666sh
bigbrother666sh merged commit ed26609 into TeamWiseFlow:master Jul 22, 2026
2 checks passed
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


codes-factory-of-bg seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@bigbrother666sh
bigbrother666sh deleted the fix/win-camoufox-shim-and-plugins-list-stderr branch July 22, 2026 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants