fix:"pnpm",没写版本,corepack 直接报错。
Some checks failed
Build and Deploy Front / deploy (push) Failing after 39s

This commit is contained in:
xiaolipro 2026-09-07 10:56:22 +08:00
parent 93c48801a3
commit f590e77877
2 changed files with 7 additions and 4 deletions

View File

@ -1,10 +1,13 @@
# k3s / Kaniko:静态 SPA(方案 A)。API 直连 api.ideship.com,镜像内 nginx 不做反代
# 基础镜像走 DaoCloud 代理,避免 Kaniko 直连 docker.io 超时
# 基础镜像走 DaoCloud,避免 Kaniko 直连 docker.io 超时
FROM docker.m.daocloud.io/library/node:20-alpine AS build
WORKDIR /app
RUN corepack enable && corepack prepare pnpm@9 --activate
# 不用 corepack(要求 packageManager 带版本且在部分环境易挂),直接装 pnpm
RUN npm config set registry https://registry.npmmirror.com \
&& npm install -g pnpm@9.15.9
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile
RUN pnpm config set registry https://registry.npmmirror.com \
&& pnpm install --frozen-lockfile
COPY . .
RUN pnpm run build

View File

@ -5,7 +5,7 @@
"private": true,
"author": "ArcoDesign Team",
"license": "MIT",
"packageManager": "pnpm",
"packageManager": "pnpm@9.15.9",
"type": "module",
"scripts": {
"preinstall": "node -e \"if (!process.env.npm_config_user_agent || !process.env.npm_config_user_agent.includes('pnpm')) { console.error('Please use pnpm to install dependencies.'); process.exit(1); }\"",