fix(install.ps1): 原生命令 stderr 在 Stop 下误抛 NativeCommandError - #456
Merged
bigbrother666sh merged 1 commit intoJul 22, 2026
Merged
Conversation
$ErrorActionPreference='Stop' + 原生命令 2>&1 合并进管道 → stderr 行变 ErrorRecord
→ Stop 当 terminating error 抛 NativeCommandError/RemoteException。pip install 正常把
进度条/警告写 stderr,用户 Win 实测卡在 'Installing python skill deps' 这步。
修法:加 Invoke-Streamed helper,临时切 $ErrorActionPreference='Continue' 跑原生命令
并按行回显 stdout+stderr,$LASTEXITCODE 仍由调用方判成败。替换 6 处
'2>&1 | ForEach-Object { Write-Host }' 调用点:pip / camoufox-cli install /
openclaw plugins install / daemon install / gateway restart×2。其余原生调用
(pnpm/npm/bash/tar/channels login)未走 2>&1,stderr 直写控制台不触发 Stop,不动。
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
用户 Win 实测
install.ps1卡在Installing python skill deps:根因:脚本顶部
$ErrorActionPreference="Stop"+ 原生命令2>&1合并进管道 → stderr 行变 ErrorRecord → Stop 当 terminating error 抛NativeCommandError/RemoteException。pip install 正常把进度条/警告写 stderr,所以一跑就炸。修法:加
Invoke-Streamedhelper,临时切$ErrorActionPreference='Continue'跑原生命令并按行回显 stdout+stderr,$LASTEXITCODE仍由调用方判成败。替换 6 处2>&1 | ForEach-Object { Write-Host }调用点:pip / camoufox-cli install / openclaw plugins install / daemon install / gateway restart×2。其余原生调用(pnpm/npm/bash/tar/channels login)未走
2>&1,stderr 直写控制台不触发 Stop,不动。install.ps1 走 raw URL 拉取(
irm raw.githubusercontent.com/.../master/scripts/install.ps1 | iex),合到 master 即生效,无需重建 tarball。