Fix Windows installation timeout with smart retry mechanism (#1071)

Problem:
- Windows users experiencing 10-minute timeout during first build
- Network detection didn't help users with low latency but slow downloads
- Native compilation and antivirus scanning make Windows builds slower

Solution:
1. Increase timeout: Windows 15min (from 10min), other platforms 10min (from 5min)
2. Smart retry: Auto-retry with CN mirror if first attempt times out
3. Better UX: Show expected time (10-15min for Windows first build)
4. Documentation: Add Windows timeout troubleshooting to FAQ

Technical changes:
- BaseBuilder.ts: Implement try-catch with automatic mirror fallback
- FAQ: Document the issue, causes, and solutions in both EN/CN
- User-friendly messages for first-time setup expectations

Fixes #1071
This commit is contained in:
Claude
2025-11-13 06:30:24 +00:00
parent 6e2c1c22bf
commit 07afdd8eeb
4 changed files with 200 additions and 37 deletions

48
docs/faq_CN.md vendored
View File

@@ -6,6 +6,54 @@
## 构建问题
### Windows首次构建时安装超时
**问题描述:**
在 Windows 上首次构建时,可能遇到:
```txt
Error: Command timed out after 900000ms: "cd ... && pnpm install"
```
**原因分析:**
Windows 首次安装可能较慢,原因包括:
- 本地模块编译(需要 Visual Studio Build Tools
- 大量依赖下载Tauri、Rust 工具链)
- Windows Defender 实时扫描
- 网络连接问题
**解决方案 1自动重试内置**
Pake CLI 现在会在初次安装超时后自动使用国内镜像重试。只需等待重试完成即可。
**解决方案 2手动安装依赖**
如果自动重试失败,可手动安装依赖:
```bash
# 进入 pake-cli 安装目录
cd %LOCALAPPDATA%\pnpm\global\5\.pnpm\pake-cli@版本号\node_modules\pake-cli
# 使用国内镜像安装
pnpm install --registry=https://registry.npmmirror.com
# 然后重新构建
pake https://github.com --name GitHub
```
**解决方案 3改善网络环境**
- 使用稳定的网络连接
- 安装过程中临时关闭杀毒软件
- 必要时使用 VPN 或代理
**预期时间:**
- 首次安装Windows 上需要 10-15 分钟
- 后续构建:依赖已缓存,速度会快很多
---
### LinuxAppImage 构建失败,提示 "failed to run linuxdeploy"
**问题描述:**