Skip to content

Commit dedc53b

Browse files
committed
fix: 修复GitHub Actions依赖安装错误
🐛 问题: - GitHub Actions 报错找不到 package-lock.json - cache: 'npm' 需要lock文件才能工作 ✅ 解决方案: - 移除 cache: 'npm' 配置 - 改用 'npm install' 代替 'npm ci' - 首次部署不需要缓存,后续可优化 📝 说明: - npm ci 要求 package-lock.json 存在且精确匹配 - npm install 更灵活,会自动生成依赖树 - .gitignore 中保持忽略 package-lock.json(避免提交大文件)
1 parent 3cf020f commit dedc53b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

.github/workflows/deploy.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,9 @@ jobs:
2828
uses: actions/setup-node@v4
2929
with:
3030
node-version: '18'
31-
cache: 'npm'
3231

3332
- name: 安装依赖
34-
run: npm ci
33+
run: npm install
3534

3635
- name: 构建项目
3736
run: npm run build

0 commit comments

Comments
 (0)