Skip to content

Commit e38416f

Browse files
DangDang
authored andcommitted
fix: Resolve npm ci missing package-lock.json issue
- Change npm ci to npm install in CI/CD workflows - Update cache key to use package.json instead of package-lock.json - Fix dependency installation in GitHub Actions - Ensure CI/CD works without committed lockfile Fixes: ✅ npm ci missing package-lock.json error ✅ Cache key resolution issues ✅ Dependency installation in CI/CD ✅ More reliable frontend builds
1 parent 827c2a3 commit e38416f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

.github/workflows/frontend-ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ jobs:
2828
uses: actions/cache@v3
2929
with:
3030
path: VehicleShowroom/node_modules
31-
key: ${{ runner.os }}-npm-${{ hashFiles('VehicleShowroom/package-lock.json') }}
31+
key: ${{ runner.os }}-npm-${{ hashFiles('VehicleShowroom/package.json') }}
3232
restore-keys: |
3333
${{ runner.os }}-npm-
3434
3535
- name: Install dependencies
3636
working-directory: ./VehicleShowroom
37-
run: npm ci
37+
run: npm install
3838

3939
- name: Run tests
4040
working-directory: ./VehicleShowroom
@@ -61,13 +61,13 @@ jobs:
6161
uses: actions/cache@v3
6262
with:
6363
path: VehicleShowroom/node_modules
64-
key: ${{ runner.os }}-npm-${{ hashFiles('VehicleShowroom/package-lock.json') }}
64+
key: ${{ runner.os }}-npm-${{ hashFiles('VehicleShowroom/package.json') }}
6565
restore-keys: |
6666
${{ runner.os }}-npm-
6767
6868
- name: Install dependencies
6969
working-directory: ./VehicleShowroom
70-
run: npm ci
70+
run: npm install
7171

7272
- name: Build application
7373
working-directory: ./VehicleShowroom

.github/workflows/fullstack-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ jobs:
2323
uses: actions/cache@v3
2424
with:
2525
path: VehicleShowroom/node_modules
26-
key: ${{ runner.os }}-npm-${{ hashFiles('VehicleShowroom/package-lock.json') }}
26+
key: ${{ runner.os }}-npm-${{ hashFiles('VehicleShowroom/package.json') }}
2727
restore-keys: |
2828
${{ runner.os }}-npm-
2929
3030
- name: Install frontend dependencies
3131
working-directory: ./VehicleShowroom
32-
run: npm ci
32+
run: npm install
3333

3434
- name: Run frontend tests
3535
working-directory: ./VehicleShowroom

0 commit comments

Comments
 (0)