Skip to content

Commit 84699c5

Browse files
committed
fix: prevent node_modules removal during workflow cleanup
- Remove node_modules deletion from clean step - npm ci already provides clean dependency state - Keeps native binaries (rollup, etc.) available for build process - Fixes 'Cannot find module @rollup/rollup-linux-x64-gnu' error
1 parent eb2ed73 commit 84699c5

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

.github/workflows/release.yml

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,9 @@ jobs:
3636
node-version: 20
3737
- name: Clean up
3838
run: |
39-
node -e "
40-
const fs = require('fs');
41-
const path = require('path');
42-
const nodeModules = path.join(process.cwd(), 'node_modules');
43-
try {
44-
if (fs.existsSync(nodeModules)) {
45-
fs.rmSync(nodeModules, { recursive: true, force: true });
46-
console.log('Removed node_modules');
47-
} else {
48-
console.log('node_modules not found');
49-
}
50-
} catch (e) {
51-
console.log('Error removing node_modules:', e.message);
52-
}
53-
"
39+
# Skip node_modules removal since npm ci provides clean state
40+
# and removing it breaks native binaries needed for build
41+
npm cache clean --force || true
5442
- run: npm ci
5543
# - name: add macos cert
5644
# if: contains(matrix.os.name, 'macos') && secrets.MACOS_CERT_P12

0 commit comments

Comments
 (0)