Skip to content

Commit d60ea58

Browse files
committed
fix: update GitHub Actions workflows to handle npm optional dependencies bug
- Remove package-lock.json and node_modules before npm install - Use --no-optional flag to avoid platform-specific dependencies - Remove npm cache from setup-node action since we delete package-lock.json - Fixes build failures on Linux CI environments
1 parent 52088b6 commit d60ea58

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

.github/workflows/lint.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ jobs:
2828
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
2929

3030
- name: Install Node Dependencies
31-
run: npm ci --omit=optional
31+
run: |
32+
# Workaround for npm optional dependencies bug
33+
# https://github.com/npm/cli/issues/4828
34+
rm -rf node_modules package-lock.json
35+
npm install --no-optional
3236
3337
- name: Run Pint
3438
run: vendor/bin/pint

.github/workflows/tests.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,13 @@ jobs:
2929
uses: actions/setup-node@v4
3030
with:
3131
node-version: '22'
32-
cache: 'npm'
3332

3433
- name: Install Node Dependencies
35-
run: npm ci --omit=optional
34+
run: |
35+
# Workaround for npm optional dependencies bug
36+
# https://github.com/npm/cli/issues/4828
37+
rm -rf node_modules package-lock.json
38+
npm install --no-optional
3639
3740
- name: Install Dependencies
3841
run: composer install --no-interaction --prefer-dist --optimize-autoloader

0 commit comments

Comments
 (0)