"open code upgrade --method=brew" fails with "$HOME must be set to run brew" #2456

Closed
opened 2026-02-16 17:35:43 -05:00 by yindo · 8 comments
Owner

Originally created by @e-roux on GitHub (Nov 1, 2025).

Originally assigned to: @thdxr on GitHub.

Description

Hello!

I guess this is a bug because HOME is set in my terminal. Or anything wrongly set in my brew installation?

❯ opencode upgrade --method=brew

┌  Upgrade
│
●  Using method: brew
│
●  From 1.0.7 → 1.0.9

■  Upgrade failed

■  Error: $HOME must be set to run brew.
│
│
└  Done

OpenCode version

1.0.7

Steps to reproduce

opencode upgrade --method=brew on MacOS

Screenshot and/or share link

No response

Operating System

macOC 15.7.1

Terminal

wezterm

Originally created by @e-roux on GitHub (Nov 1, 2025). Originally assigned to: @thdxr on GitHub. ### Description Hello! I guess this is a bug because HOME is set in my terminal. Or anything wrongly set in my brew installation? ```shell ❯ opencode upgrade --method=brew ┌ Upgrade │ ● Using method: brew │ ● From 1.0.7 → 1.0.9  ■ Upgrade failed  ■ Error: $HOME must be set to run brew. │ │ └ Done ``` ### OpenCode version 1.0.7 ### Steps to reproduce `opencode upgrade --method=brew` on MacOS ### Screenshot and/or share link _No response_ ### Operating System macOC 15.7.1 ### Terminal wezterm
yindo added the opentuibug labels 2026-02-16 17:35:43 -05:00
yindo closed this issue 2026-02-16 17:35:43 -05:00
Author
Owner

@alesmartan commented on GitHub (Nov 6, 2025):

same thing for me here

@alesmartan commented on GitHub (Nov 6, 2025): same thing for me here
Author
Owner

@thdxr commented on GitHub (Nov 6, 2025):

fixed

@thdxr commented on GitHub (Nov 6, 2025): fixed
Author
Owner

@abeisleem commented on GitHub (Nov 6, 2025):

I'm still getting this. I've tried explicitly setting $HOME though it's already set export $HOME='/Users/abe'

Upgrading from 1.0.24.

I've also tried brew uninstall opencode && brew install opencode@1.0.35 and get Warning: No available formula with the name "opencode@1.0.35". Did you mean opencode?

EDIT:
mind you, i used to install previously with npm install -g opencode but uninstalled due to similar upgrade errors and started using brew

@abeisleem commented on GitHub (Nov 6, 2025): I'm still getting this. I've tried explicitly setting $HOME though it's already set `export $HOME='/Users/abe'` Upgrading from 1.0.24. I've also tried `brew uninstall opencode && brew install opencode@1.0.35` and get `Warning: No available formula with the name "opencode@1.0.35". Did you mean opencode?` EDIT: mind you, i used to install previously with `npm install -g opencode` but uninstalled due to similar upgrade errors and started using brew
Author
Owner

@rekram1-node commented on GitHub (Nov 6, 2025):

@abeisleem you can't install specific versions easily with homebrew, just do brew install opencode and it will or should grab the latest version

Note: if you are using the homebrew official formula their versions are on a 4-6hr delay.

You can also use the sst/tap/opencode version instead if you prefer

@rekram1-node commented on GitHub (Nov 6, 2025): @abeisleem you can't install specific versions easily with homebrew, just do `brew install opencode` and it will or should grab the latest version Note: if you are using the homebrew official formula their versions are on a 4-6hr delay. You can also use the sst/tap/opencode version instead if you prefer
Author
Owner

@abeisleem commented on GitHub (Nov 6, 2025):

good enough, thanks @rekram1-node!

@abeisleem commented on GitHub (Nov 6, 2025): good enough, thanks @rekram1-node!
Author
Owner

@PWCoder commented on GitHub (Nov 11, 2025):

When I do this on mac today, I get this message saying that 0.14.7 is the latest version:

(My command) > brew install opencode
(Output) >Warning: opencode 0.14.7 is already installed and up-to-date.
To reinstall 0.14.7, run:
brew reinstall opencode

How can I get it to pick up the latest version?

@PWCoder commented on GitHub (Nov 11, 2025): When I do this on mac today, I get this message saying that 0.14.7 is the latest version: (My command) > brew install opencode (Output) >Warning: opencode 0.14.7 is already installed and up-to-date. To reinstall 0.14.7, run: brew reinstall opencode How can I get it to pick up the latest version?
Author
Owner

@rekram1-node commented on GitHub (Nov 11, 2025):

@PWCoder maybe do brew uninstall opencode and then install fresh?

@rekram1-node commented on GitHub (Nov 11, 2025): @PWCoder maybe do `brew uninstall opencode` and then install fresh?
Author
Owner

@PWCoder commented on GitHub (Nov 11, 2025):

@rekram1-node Thanks for the reply, I had tried that.
You got me thinking though and I updated brew and it fixed the issue.

@PWCoder commented on GitHub (Nov 11, 2025): @rekram1-node Thanks for the reply, I had tried that. You got me thinking though and I updated brew and it fixed the issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2456