Skip to content

Commit 2f9633c

Browse files
committed
Fix CI optional dependencies issue (npm #4828)
Use --include=optional flag and regenerate package-lock.json in CI to ensure platform-specific binaries (Rollup, LightningCSS) are installed correctly. This addresses the known npm bug where optional dependencies for other platforms are excluded from package-lock.json when node_modules exists.
1 parent ac28b37 commit 2f9633c

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,16 @@ jobs:
3333
- name: Install dependencies
3434
if: steps.cache-node-modules.outputs.cache-hit != 'true'
3535
run: |
36-
npm ci
36+
# Workaround for npm bug #4828 with optional dependencies
37+
# Delete lock file and reinstall to ensure all optional deps are included
38+
rm -f package-lock.json
39+
npm install --include=optional
40+
41+
- name: Verify installation
42+
run: |
43+
# Quick verification that problematic packages work
44+
npx rollup --version
45+
node -e "console.log('LightningCSS check:', !!require('lightningcss'))" || echo "LightningCSS not available"
3746
3847
- name: Run linter (includes formatting)
3948
run: npm run lint

0 commit comments

Comments
 (0)