Skip to content

Commit 5cddef9

Browse files
anandgupta42claude
andcommitted
fix: add --force to npm/pnpm/bun upgrade to prevent stale native binaries
Without `--force`, package managers may serve cached platform binaries from `@altimateai/altimate-core`'s `optionalDependencies`. The caret range (`^0.2.5`) lets npm skip re-downloading if the cached version satisfies the range, even when a newer version with additional exports exists. `--force` ensures all dependencies are re-resolved and re-fetched from the registry during auto-upgrade. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 959d580 commit 5cddef9

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

  • packages/opencode/src/installation

packages/opencode/src/installation/index.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,15 +182,23 @@ export namespace Installation {
182182
case "curl":
183183
result = await upgradeCurl(target)
184184
break
185+
// altimate_change start — force re-fetch to prevent stale native binaries
186+
// Without --force, npm/pnpm/bun may serve cached platform binaries from
187+
// @altimateai/altimate-core's optionalDependencies (e.g. darwin-arm64).
188+
// The caret range (^0.2.5) lets npm skip re-downloading if the cached
189+
// version satisfies the range, even when a newer version with additional
190+
// exports exists. --force ensures all dependencies are re-resolved and
191+
// re-fetched from the registry.
185192
case "npm":
186-
result = await Process.run(["npm", "install", "-g", `@altimateai/altimate-code@${target}`], { nothrow: true })
193+
result = await Process.run(["npm", "install", "-g", "--force", `@altimateai/altimate-code@${target}`], { nothrow: true })
187194
break
188195
case "pnpm":
189-
result = await Process.run(["pnpm", "install", "-g", `@altimateai/altimate-code@${target}`], { nothrow: true })
196+
result = await Process.run(["pnpm", "install", "-g", "--force", `@altimateai/altimate-code@${target}`], { nothrow: true })
190197
break
191198
case "bun":
192-
result = await Process.run(["bun", "install", "-g", `@altimateai/altimate-code@${target}`], { nothrow: true })
199+
result = await Process.run(["bun", "install", "-g", "--force", `@altimateai/altimate-code@${target}`], { nothrow: true })
193200
break
201+
// altimate_change end
194202
case "brew": {
195203
const formula = await getBrewFormula()
196204
const env = {

0 commit comments

Comments
 (0)