opencode icon indicating copy to clipboard operation
opencode copied to clipboard

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

Open e-roux opened this issue 1 year ago • 8 comments

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

e-roux avatar Nov 01 '25 17:11 e-roux

same thing for me here

alesmartan avatar Nov 06 '25 05:11 alesmartan

fixed

thdxr avatar Nov 06 '25 05:11 thdxr

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 [email protected] and get Warning: No available formula with the name "[email protected]". 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 avatar Nov 06 '25 06:11 abeisleem

@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 avatar Nov 06 '25 06:11 rekram1-node

good enough, thanks @rekram1-node!

abeisleem avatar Nov 06 '25 06:11 abeisleem

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 avatar Nov 11 '25 08:11 PWCoder

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

rekram1-node avatar Nov 11 '25 16:11 rekram1-node

@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 avatar Nov 11 '25 17:11 PWCoder