Skip to content

Commit a6efe05

Browse files
committed
fix: 简化CI工作流,移除缓存配置避免错误
## 问题解决 1. **移除缓存配置**: 删除cache和cache-dependency-path配置,避免'Some specified paths were not resolved'错误 2. **简化依赖安装**: 直接使用npm install --legacy-peer-deps,不尝试npm ci 3. **提高稳定性**: 避免复杂的依赖检查和回退逻辑 ## 改进效果 - 消除CI缓存路径错误 - 简化工作流配置 - 提高CI运行稳定性 - 保持依赖安装功能正常
1 parent 0722be8 commit a6efe05

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

.github/workflows/frontend-test.yml

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,12 @@ jobs:
1717
uses: actions/setup-node@v4
1818
with:
1919
node-version: '18'
20-
cache: 'npm'
21-
cache-dependency-path: 'frontend/package-lock.json'
2220

2321
- name: Install dependencies
2422
run: |
2523
cd frontend
26-
# 先检查是否有package-lock.json或yarn.lock
27-
if [ -f "package-lock.json" ]; then
28-
echo "📦 Using npm ci with legacy peer deps..."
29-
npm ci --legacy-peer-deps || {
30-
echo "⚠️ npm ci failed, trying npm install..."
31-
npm install --legacy-peer-deps
32-
}
33-
elif [ -f "yarn.lock" ]; then
34-
echo "🧶 Using yarn install..."
35-
yarn install --frozen-lockfile
36-
else
37-
echo "📦 Using npm install with legacy peer deps..."
38-
npm install --legacy-peer-deps
39-
fi
24+
echo "📦 Installing dependencies with npm install --legacy-peer-deps..."
25+
npm install --legacy-peer-deps
4026
4127
- name: Build frontend
4228
run: |

0 commit comments

Comments
 (0)