galaxy-opc 0.5.21 → 0.5.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cli.mjs +4 -1
- package/package.json +1 -1
package/bin/cli.mjs
CHANGED
|
@@ -176,7 +176,7 @@ async function installOpenclawWithFallback() {
|
|
|
176
176
|
{
|
|
177
177
|
label: "官方源",
|
|
178
178
|
args: ["install", "-g", "openclaw@latest"],
|
|
179
|
-
timeout:
|
|
179
|
+
timeout: 120_000, // 120s 超时
|
|
180
180
|
},
|
|
181
181
|
{
|
|
182
182
|
label: "国内镜像(npmmirror)",
|
|
@@ -187,6 +187,9 @@ async function installOpenclawWithFallback() {
|
|
|
187
187
|
|
|
188
188
|
let lastErr = null;
|
|
189
189
|
for (const attempt of attempts) {
|
|
190
|
+
// 清理上次失败/中断留下的残留目录,防止 ENOTEMPTY 报错
|
|
191
|
+
try { execSync("npm uninstall -g openclaw", { stdio: "ignore" }); } catch { /* ignore */ }
|
|
192
|
+
|
|
190
193
|
console.log(dim(` 尝试 ${attempt.label} 安装 OpenClaw...(超时 ${attempt.timeout / 1000}s 自动切换)\n`));
|
|
191
194
|
try {
|
|
192
195
|
await runCommand("npm", attempt.args, { env, timeout: attempt.timeout });
|