Repository navigation
fix(update): install from the official npm registry to match version detection - #333
Merged
Merged
Conversation
…detection Version detection queries registry.npmjs.org, but npm install ran against the user-configured registry (e.g. the Alibaba internal mirror). When the mirror lags behind a publish, npm silently reinstalled the current version and the update reported "X → X" as success. Install with --registry=<official> in both bl update and auto-update so the two steps use the same source.
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.
Summary
bl update检测版本与安装版本走了不同的 npm 源:检测固定查询官方源registry.npmjs.org,而npm install -g bailian-cli@latest使用用户~/.npmrc配置的 registry(如阿里内网镜像)。镜像同步滞后时,npm 会静默重装当前版本,更新后提示2.10.4 → 2.10.4(谎报成功)。修复:两条 npm 安装路径(
bl update与自动更新performAutoUpdate)统一追加--registry=https://registry.npmjs.org,与检测同源;--to固定版本路径同样生效。Changes
packages/commands/src/commands/update.ts:npm 安装命令追加--registry=${NPM_REGISTRY}packages/runtime/src/utils/update-checker.ts:performAutoUpdate同样追加Evidence
实测(2026-11-23,2.10.5 发布于 05:41Z):
latest= 2.10.5,版本列表含 2.10.5registry.anpm.alibaba-inc.com:latest= 2.10.4,无 2.10.5(空缓存复现,排除本地缓存)Test plan
vp test packages/runtime/tests/update-checker.test.ts packages/commands/tests/update-binary-skill-sync.test.ts:28 passed,1.64svp check:0 errors(2 warnings 为tools/release存量,与本次无关)bl update端到端:需等待包含本修复的版本发布后验证