fix: web 打包改用 Node 18 与 legacy-peer-deps,规避 npm edgesOut 错误

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
zlwuandCursor committed 2026-10-24 12:04:32 +08:00
1 parent 6ccb9f8cd4
commit 2fac0c91f6
1 file changed
+5 -4
+5 -4
View File
@@ -36,16 +36,17 @@ steps:
- ls -lh "/hzdyjs-releases/${DRONE_TAG}/backend-${DRONE_TAG}.jar"
- name: package-web
image: node:20-bookworm
# Node 20 + 无 lock 时 npm 易触发 edgesOut 空指针;18 + legacy-peer-deps 更稳
image: node:18-bookworm
environment:
NPM_CONFIG_REGISTRY: https://registry.npmmirror.com
commands:
- set -eu
- echo "==> web tag=${DRONE_TAG}"
- echo "==> web tag=${DRONE_TAG} npm=$(npm -v) node=$(node -v)"
- mkdir -p "/hzdyjs-releases/${DRONE_TAG}"
- cd web
# package-lock.json 被 gitignore,仓库内无 lock,改用 npm install
- npm install
# package-lock.json 被 gitignore,仓库内无 lock
- npm install --legacy-peer-deps --no-audit --no-fund
- npm run build:prod
- test -f dist/index.html
- tar -C dist -czf "/hzdyjs-releases/${DRONE_TAG}/web-${DRONE_TAG}.tar.gz" .