@andyqiu/codeforge 0.8.18 → 0.8.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/codeforge.mjs CHANGED
@@ -251,11 +251,10 @@ async function cmdUpgrade(args) {
251
251
  }
252
252
 
253
253
  const npmCmd = process.platform === "win32" ? "npm.cmd" : "npm"
254
- // 有明确版本号时用精确版本,绕过 @latest dist-tag 缓存
255
- const installTarget = latestVersion
256
- ? `@andyqiu/codeforge@${latestVersion}`
257
- : "@andyqiu/codeforge@latest"
258
- const npmArgs = ["install", "-g", installTarget, "--no-audit", "--no-fund", "--prefer-offline"]
254
+ // 始终用 @latest 安装,避免 CDN 同步延迟导致的 ETARGET 错误
255
+ // 精确版本号仅用于展示,不用于 npm install
256
+ const installTarget = "@andyqiu/codeforge@latest"
257
+ const npmArgs = ["install", "-g", installTarget, "--no-audit", "--no-fund"]
259
258
 
260
259
  if (dryRun) {
261
260
  const displayNew = latestVersion ?? "未知(版本查询失败)"
@@ -272,6 +271,7 @@ async function cmdUpgrade(args) {
272
271
  npm_config_fund: "false",
273
272
  },
274
273
  })
274
+
275
275
  if (r.status !== 0) {
276
276
  err(`npm install 失败 (exit=${r.status ?? 1})`)
277
277
  err(`提示:可手动跑 npm install -g ${installTarget}`)