This commit is contained in:
Tw93
2025-11-13 14:52:02 +08:00
3 changed files with 13 additions and 3 deletions

View File

@@ -144,8 +144,12 @@ export default abstract class BaseBuilder {
} catch (error: any) {
// If installation times out and we haven't tried the mirror yet, retry with mirror
if (error.message?.includes('timed out') && !usedMirror) {
spinner.fail(chalk.yellow('Installation timed out, retrying with CN mirror...'));
logger.info('✺ Retrying installation with CN mirror for better speed...');
spinner.fail(
chalk.yellow('Installation timed out, retrying with CN mirror...'),
);
logger.info(
'✺ Retrying installation with CN mirror for better speed...',
);
const retrySpinner = getSpinner('Retrying installation...');
usedMirror = true;
@@ -158,7 +162,9 @@ export default abstract class BaseBuilder {
timeout,
buildEnv,
);
retrySpinner.succeed(chalk.green('Package installed with CN mirror!'));
retrySpinner.succeed(
chalk.green('Package installed with CN mirror!'),
);
} catch (retryError) {
retrySpinner.fail(chalk.red('Installation failed'));
throw retryError;

2
docs/faq.md vendored
View File

@@ -18,6 +18,7 @@ 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
@@ -49,6 +50,7 @@ pake https://github.com --name GitHub
- Use a VPN or proxy if needed
**Expected Time:**
- First installation: 10-15 minutes on Windows
- Subsequent builds: Much faster (dependencies cached)

2
docs/faq_CN.md vendored
View File

@@ -18,6 +18,7 @@ Error: Command timed out after 900000ms: "cd ... && pnpm install"
**原因分析:**
Windows 首次安装可能较慢,原因包括:
- 本地模块编译(需要 Visual Studio Build Tools
- 大量依赖下载Tauri、Rust 工具链)
- Windows Defender 实时扫描
@@ -49,6 +50,7 @@ pake https://github.com --name GitHub
- 必要时使用 VPN 或代理
**预期时间:**
- 首次安装Windows 上需要 10-15 分钟
- 后续构建:依赖已缓存,速度会快很多