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.md vendored
View File

@@ -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:**