fix: CI 改用 pnpm 解决 npm 'Exit handler never called' 崩溃

GitHub runner 上 npm install/ci 反复 'Exit handler never called!' 崩溃
(72s 无输出后退出),改用 pnpm 9 + Node 22:
- pnpm/action-setup@v4 + setup-node cache pnpm
- 生成 pnpm-lock.yaml,删除 package-lock.json
- package.json 加 packageManager 字段,scripts 统一 pnpm
This commit is contained in:
riba2534
2026-06-28 13:28:04 +08:00
parent 9566ffd438
commit 62437b6886
4 changed files with 1634 additions and 2559 deletions

View File

@@ -14,18 +14,22 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: '20'
node-version: '22'
cache: 'pnpm'
cache-dependency-path: site/pnpm-lock.yaml
- name: Install dependencies
run: npm install --no-fund --no-audit
run: pnpm install --no-frozen-lockfile
working-directory: site
env:
NODE_OPTIONS: '--max-old-space-size=4096'
- name: Build site
run: npm run build
run: pnpm run build
working-directory: site
env:
NODE_OPTIONS: '--max-old-space-size=4096'

2550
site/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -4,11 +4,12 @@
"type": "module",
"scripts": {
"gen": "node scripts/build.mjs",
"dev": "npm run gen && vitepress dev",
"build": "npm run gen && vitepress build",
"dev": "pnpm run gen && vitepress dev",
"build": "pnpm run gen && vitepress build",
"preview": "vitepress preview"
},
"devDependencies": {
"vitepress": "^1.5.0"
}
}
},
"packageManager": "pnpm@9.15.9"
}

1620
site/pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff