fix: 固定 frontend Dockerfile 中的 pnpm 版本 - #121
Open
dajiaohuang wants to merge 1 commit into
Open
Conversation
frontend/Dockerfile 安装 pnpm 时未指定版本,全新环境下会装到最新的 pnpm。 新版 pnpm 会依据 package.json 的 packageManager 字段下载 @pnpm/exe,并到 pnpm-lock.yaml 中校验其完整性;现有 lockfile 不含该记录,导致 `pnpm install --frozen-lockfile` 报 ERR_PNPM_PNPM_ENGINE_IDENTITY_UNVERIFIABLE 而构建失败。 固定为 packageManager 声明的 10.6.3 后,容器内的 pnpm 与声明版本一致, 不再触发版本切换和完整性校验。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
改动
frontend/Dockerfile安装 pnpm 时未指定版本,全新环境(无构建缓存)会装到当时的最新版 pnpm。新版 pnpm 会依据package.json的packageManager字段切换到自己声明的版本,并到pnpm-lock.yaml中校验@pnpm/exe的完整性;现有 lockfile 不含该记录,pnpm install --frozen-lockfile直接失败:把 pnpm 固定到
packageManager声明的10.6.3(与 CLAUDE.md 中「包管理用 pnpm,版本见 packageManager 字段」一致),容器内的 pnpm 与声明版本相同,不再触发版本切换和完整性校验。验证
docker build --no-cache复现上述ERR_PNPM_PNPM_ENGINE_IDENTITY_UNVERIFIABLE。docker build --no-cache通过,pnpm install --frozen-lockfile正常结束。curl localhost:5173返回 HTTP 200,Vite dev server 正常启动。修复 #118