feat: add npm timeout, mirror support, and interactive fallback

- Add --npm-registry param for custom npm mirrors
- Add --github-mirror param for GitHub API/download proxy
- npm install now has 120s timeout with interactive fallback menu
- On timeout/failure, prompt user to switch source or use mirror
- Update docs with mirror usage examples

via [HAPI](https://hapi.run)

Co-Authored-By: HAPI <[email protected]>
This commit is contained in:
i
2026-06-01 23:15:06 +08:00
co-authored by HAPI
parent 43c4fbe1e8
commit 8cb35598af
3 changed files with 283 additions and 13 deletions
+12
View File
@@ -51,6 +51,12 @@ sudo bash install.sh --force
# 仅安装/升级 CLI,跳过 Hub Docker 配置
sudo bash install.sh --skip-hub
# 指定国内 npm 镜像
sudo bash install.sh --npm-registry https://registry.npmmirror.com
# 指定 GitHub 镜像(国内环境推荐)
sudo bash install.sh --github-mirror https://ghproxy.com --source github-official
# 显示帮助
sudo bash install.sh --help
```
@@ -76,6 +82,12 @@ sudo bash install.sh --help
# 仅安装/升级 CLI
.\install.ps1 -SkipHub
# 指定国内 npm 镜像
.\install.ps1 -NpmRegistry https://registry.npmmirror.com
# 指定 GitHub 镜像(国内环境推荐)
.\install.ps1 -GithubMirror https://ghproxy.com -Source github-official
```
---