File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3939 cache : ' npm'
4040
4141 - name : Install dependencies
42- run : npm ci
42+ run : npm install
4343
4444 - name : Build documentation
4545 run : npm run typedoc:markdown
Original file line number Diff line number Diff line change 3838
39391 . ** Checkout** : 检出代码
40402 . ** Setup Node.js** : 设置 Node.js 环境
41- 3 . ** Install dependencies** : 安装项目依赖
41+ 3 . ** Install dependencies** : 安装项目依赖(使用 ` npm install ` )
42424 . ** Build documentation** : 使用 TypeDoc 生成文档
43435 . ** Setup Pages** : 配置 GitHub Pages 环境
44446 . ** Upload artifact** : 上传生成的 ` docs/ ` 目录作为构建产物
6262npm run typedoc:markdown
6363```
6464
65+ ## 依赖管理
66+
67+ ### 安装策略
68+
69+ 工作流使用 ` npm install ` 而不是 ` npm ci ` ,原因如下:
70+
71+ - ** 兼容性** : 更好地处理 ` package-lock.json ` 版本不匹配的情况
72+ - ** 灵活性** : 自动更新 lockfile 以匹配 ` package.json `
73+ - ** 稳定性** : 避免因版本差异导致的安装失败
74+
75+ ### 缓存优化
76+
77+ - 使用 GitHub Actions 的 npm 缓存
78+ - 减少重复安装的时间
79+
6580## 自定义配置
6681
6782### 修改部署路径
@@ -91,7 +106,7 @@ paths:
91106# ## 常见问题
92107
931081. **构建失败** : 检查 TypeScript 编译错误
94- 2. **依赖安装失败** : 检查 `package-lock.json` 是否最新
109+ 2. **依赖安装失败** : 检查网络连接和 npm 配置
951103. **部署失败** : 检查 Actions 标签中的错误信息
961114. **页面不显示** : 确保 TypeDoc 成功生成了 `docs/` 目录
97112
@@ -121,3 +136,4 @@ python -m http.server 8000 # 或其他本地服务器
121136- 确保 TypeScript 代码能够正常编译
122137- ` .nojekyll` 文件确保 GitHub Pages 不会使用 Jekyll 处理
123138- 文档基于 `src/index.ts` 中的导出内容生成
139+ - 使用 `npm install` 确保依赖版本兼容性
You can’t perform that action at this time.
0 commit comments