Repository navigation
Install on Apple M3 Max #256
Description
Activity
I have an Apple M3 Max MacBook Pro and installed opencode via
npm i -g opencode-ai@latestand it runs without issue.hmmm. I did the same.
A couple times.I will try again and do some debugging
can you run
which opencodeand show me where it iswhich opencode /usr/local/bin/opencodeThen when I run
opencodeI get nothing returned in my terminal emulator appIn mac terminal I get
~ % opencode zsh: illegal hardware instruction opencodeBash session
$ opencode Illegal instruction: 4ok so i think that's the one that's brew installed? let me try to recreate i have a macbook air m3
No. I used npm
npm i -g opencode-ai@latestBut I have tried both with the same results.
I just checked claude code and it runs from
claude: aliased to /Users/jeffrey/.claude/local/claudeDigging deeper I find that its real path is
/usr/local/lib/node_modules/opencode-ai/bin/opencode@topdown Did you potentially have https://github.com/opencode-ai/opencode installed from before? It's got the same name, though I couldn't get their tool to work properly 😅 Before trying the Better™ opencode, I made sure to remove that one (
brew uninstall opencode-ai/tap/opencode).FWIW, I use
miseandwhich opencodeprints this for me:/Users/robertkomaromi/.local/share/mise/installs/node/22.16.0/bin/opencode@topdown Did you potentially have https://github.com/opencode-ai/opencode installed from before? It's got the same name, though I couldn't get their tool to work properly 😅 Before trying the Better™ opencode, I made sure to remove that one (
brew uninstall opencode-ai/tap/opencode).FWIW, I use
miseandwhich opencodeprints this for me:/Users/robertkomaromi/.local/share/mise/installs/node/22.16.0/bin/opencodeNo. I have a clean system.
I checked for both that one and this one in Brew and NPM
Both clean.I have the exact same issue. Tried all install sources, but no dice.
Same problem here.
Ok, so I forked it.
Tried to install dependencies, got lame errors, so as a guess I updated bun.
Then the dependencies are installed.The first startup took forever, to the point I thought it failed to do anything.
It asked me for a provider key, I picked Google, gave it my keyThen it installed Go, and a bunch of Go dependencies.
Finally I see the OpenCode screen. But,
initdoes nothing, I do not see any way to switch providers, and sending a message gives me an error
Typing /editor opened Cursor with a md file at some crazy path
So basically there is nothing I can do with OpenCode, its basically useless on my machine currently.
Same issue here on the m1 max
Similar issue on M4 Max when trying to install with
brew ~/ brew install sst/tap/opencode Warning: sst/tap/opencode 0.3.5 is already installed and up-to-date. To reinstall 0.3.5, run: brew reinstall opencode ~/ which opencode /usr/local/bin/opencode ~/ opencode auth login ============================================================ Bun v1.2.17 (282dda62) macOS x64 macOS v15.2 CPU: sse42 popcnt Args: Features: no_avx2 no_avxThe app just hangs and doesn't do anything when I try to run the
auth logincommand. Trying to install with npm yields the same result. ~/ npm i -g opencode-ai@latest added 2 packages in 2s ~/ opencode auth login ============================================================ Bun v1.2.17 (282dda62) macOS x64 macOS v15.2 CPU: sse42 popcnt Args: Features: no_avx2 no_avxtrying to understand the issue - this is only with brew installed versions of opencode?
Reacted by Murtagy and Lollekatrying to understand the issue - this is only with brew installed versions of opencode?
I had the same experience with both the
brewinstalled andnpminstalled versions. I'm on Sequoia 15.2 for reference.I was also facing this issue when installing via
brewandnpm.Installing the binary directly worked for me. The following steps installed it successfully (Apple m1 max):
curl -LO https://github.com/sst/opencode/releases/download/v0.3.13/opencode-darwin-arm64.zip unzip opencode-darwin-arm64.zip chmod +x opencode sudo mv ./opencode /usr/local/bin/opencode
Reacted by Lolleka, CFA2k, stevand and Amir5000Reacted by ChaysenReacted by Amir5000Reacted by Sam Bradburytrying to understand the issue - this is only with brew installed versions of opencode?
No, both brew and npm fail to work.
pretty confused by this - i'm not sure what is the common thread here that is causing it
i can't reproduce it either so i'm going to have to hope someone who can can get to the bottom of it
I was able to resolve the problem by following the instructions here for migrating homebrew from intel to apple architecture.
After updating my path things work as expected. I'm assuming something similar is going on with npm installs.
~/ which opencode /opt/homebrew/bin/opencode ~/ opencode auth login ┌ Add credential │ ◆ Select provider │ ● Anthropic (recommended) │ ○ GitHub Copilot │ ○ OpenAI │ ○ Google │ ○ Amazon Bedrock │ ○ Azure │ ○ DeepSeek │ ... └I have the same issue on intel mac when installing via npm.
% npm i -g opencode-ai@latest added 2 packages in 9s % which opencode /Users/myname/.nvm/versions/node/v22.17.1/bin/opencode % opencode zsh: illegal hardware instruction opencodeI first thought my environment was bad, but have since installed other things via npm that work as intended.
I also tried downloading the binary and installing it manually as niwoerner suggested but with the same result. I made sure no other opencode was found on the system before installing it and that
whichfound it correctly.% which opencode opencode not found % sudo mv ./opencode /usr/local/bin/opencode Password: % which opencode /usr/local/bin/opencode % opencode zsh: illegal hardware instruction opencodeHi!
I had all those issues, with npm and brew.
I finally decided to remove all the installed versions I had (so npm and brew…) and to use
bun install -g opencode-ai.Now it works well :)
Edit:
Impossible to run it using tmux. Also I get a very very very slow bun installation process for llms setup.I have exactly the same issue on Intel Macbook Air running Linux. The exactly same configuration works perfectly fine on Lenovo PC.
I did update macOS, all homebrew packages and opencode obviously. And it works well.
For me it was a HomeBrew issue, which the intel version was installed instead of the ARM version for silicon.
I just fixed the HomeBrew installation and OpenCode finally installed and works.NOTE: this issue affects both installation types, HomeBrew and NPM.
- Make sure your NPM and Node are ARM if you are on an Apple Silicon Mac.
- Make sure Homebrew is the ARM version.
I tried both npm and brew.
After installing, in a fresh terminal I run
opencodeand I get