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:
48
docs/faq.md
vendored
48
docs/faq.md
vendored
@@ -6,6 +6,54 @@ Common issues and solutions when using Pake.
|
||||
|
||||
## Build Issues
|
||||
|
||||
### Windows: Installation Timeout During First Build
|
||||
|
||||
**Problem:**
|
||||
When building for the first time on Windows, you may encounter:
|
||||
|
||||
```txt
|
||||
Error: Command timed out after 900000ms: "cd ... && pnpm install"
|
||||
```
|
||||
|
||||
**Why This Happens:**
|
||||
|
||||
First-time installation on Windows can be slow due to:
|
||||
- Native module compilation (requires Visual Studio Build Tools)
|
||||
- Large dependency downloads (Tauri, Rust toolchain)
|
||||
- Windows Defender real-time scanning
|
||||
- Network connectivity issues
|
||||
|
||||
**Solution 1: Automatic Retry (Built-in)**
|
||||
|
||||
Pake CLI now automatically retries with CN mirror if the initial installation times out. Simply wait for the retry to complete.
|
||||
|
||||
**Solution 2: Manual Installation**
|
||||
|
||||
If automatic retry fails, manually install dependencies:
|
||||
|
||||
```bash
|
||||
# Navigate to pake-cli installation directory
|
||||
cd %LOCALAPPDATA%\pnpm\global\5\.pnpm\pake-cli@VERSION\node_modules\pake-cli
|
||||
|
||||
# Install with CN mirror
|
||||
pnpm install --registry=https://registry.npmmirror.com
|
||||
|
||||
# Then retry your build
|
||||
pake https://github.com --name GitHub
|
||||
```
|
||||
|
||||
**Solution 3: Improve Network Speed**
|
||||
|
||||
- Use a stable network connection
|
||||
- Temporarily disable antivirus software during installation
|
||||
- Use a VPN or proxy if needed
|
||||
|
||||
**Expected Time:**
|
||||
- First installation: 10-15 minutes on Windows
|
||||
- Subsequent builds: Much faster (dependencies cached)
|
||||
|
||||
---
|
||||
|
||||
### Linux: AppImage Build Fails with "failed to run linuxdeploy"
|
||||
|
||||
**Problem:**
|
||||
|
||||
48
docs/faq_CN.md
vendored
48
docs/faq_CN.md
vendored
@@ -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 分钟
|
||||
- 后续构建:依赖已缓存,速度会快很多
|
||||
|
||||
---
|
||||
|
||||
### Linux:AppImage 构建失败,提示 "failed to run linuxdeploy"
|
||||
|
||||
**问题描述:**
|
||||
|
||||
Reference in New Issue
Block a user