opencode icon indicating copy to clipboard operation
opencode copied to clipboard

[求助] 安装不上

Open MuJianxuan opened this issue 1 month ago • 1 comments

Question

rao@RaodeMacBook-Air-2 ~ % npm install -g opencode-ai npm error code 1 npm error path /opt/homebrew/lib/node_modules/opencode-ai npm error command failed npm error command sh -c bun ./postinstall.mjs || node ./postinstall.mjs npm error Failed to setup opencode binary: Could not find package opencode-darwin-arm64: Cannot find module 'opencode-darwin-arm64/package.json' from '/opt/homebrew/lib/node_modules/opencode-ai/postinstall.mjs' npm error Failed to setup opencode binary: Could not find package opencode-darwin-arm64: Cannot find module 'opencode-darwin-arm64/package.json' npm error Require stack: npm error - /opt/homebrew/lib/node_modules/opencode-ai/postinstall.mjs npm error A complete log of this run can be found in: /Users/rao/.npm/_logs/2026-01-07T01_32_25_506Z-debug-0.log rao@RaodeMacBook-Air-2 ~ %

MuJianxuan avatar Jan 07 '26 01:01 MuJianxuan

Thank you for reporting this issue!

I've searched through existing issues in this repository and while I found some related installation problems, this specific error about the missing opencode-darwin-arm64 package during postinstall appears to be unique to your situation.

For context, I found these related but different installation issues you might want to check:

  • #6935: Windows npm installation error (different root cause - @openauthjs/openauth package)
  • #6640: brew install opencode formula not available

If you have any additional details about your setup (npm version, node version, whether you've tried npm install -g opencode-ai@latest or clearing npm cache), that would help the maintainers diagnose this issue.

github-actions[bot] avatar Jan 07 '26 01:01 github-actions[bot]

rao@RaodeMacBook-Air-2 ~ % npm i -g opencode-ai npm error code 1 npm error path /usr/local/lib/node_modules/opencode-ai npm error command failed npm error command sh -c bun ./postinstall.mjs || node ./postinstall.mjs npm error Failed to setup opencode binary: Could not find package opencode-darwin-arm64: Cannot find module 'opencode-darwin-arm64/package.json' from '/usr/local/lib/node_modules/opencode-ai/postinstall.mjs' npm error Failed to setup opencode binary: Could not find package opencode-darwin-arm64: Cannot find module 'opencode-darwin-arm64/package.json' npm error Require stack: npm error - /usr/local/lib/node_modules/opencode-ai/postinstall.mjs npm error A complete log of this run can be found in: /Users/rao/.npm/_logs/2026-01-07T02_47_11_755Z-debug-0.log rao@RaodeMacBook-Air-2 ~ % cat /Users/rao/.npm/_logs/2026-01-07T02_47_11_755Z-debug-0.log 0 verbose cli /usr/local/bin/node /usr/local/bin/npm 1 info using [email protected] 2 info using [email protected] 3 silly config load:file:/usr/local/lib/node_modules/npm/npmrc 4 silly config load:file:/Users/rao/.npmrc 5 silly config load:file:/usr/local/etc/npmrc 6 verbose title npm i opencode-ai 7 verbose argv "i" "--global" "opencode-ai" 8 verbose logfile logs-max:10 dir:/Users/rao/.npm/_logs/2026-01-07T02_47_11_755Z- 9 verbose logfile /Users/rao/.npm/_logs/2026-01-07T02_47_11_755Z-debug-0.log 10 silly packumentCache heap:4496293888 maxSize:1124073472 maxEntrySize:562036736 11 silly logfile start cleaning logs, removing 2 files 12 silly idealTree buildDeps 13 silly fetch manifest opencode-ai@* 14 silly packumentCache full:https://registry.npmmirror.com/opencode-ai cache-miss 15 silly logfile done cleaning log files 16 http cache https://registry.npmmirror.com/opencode-ai 13ms (cache hit) 17 silly packumentCache full:https://registry.npmmirror.com/opencode-ai set size:7924582 disposed:false 18 silly placeDep ROOT [email protected] OK for: want: * 19 silly fetch manifest [email protected] 20 silly packumentCache full:https://registry.npmmirror.com/opencode-linux-arm64 cache-miss 21 silly fetch manifest [email protected] 22 silly packumentCache full:https://registry.npmmirror.com/opencode-linux-x64 cache-miss 23 silly fetch manifest [email protected] 24 silly packumentCache full:https://registry.npmmirror.com/opencode-linux-x64-baseline cache-miss 25 silly fetch manifest [email protected] 26 silly packumentCache full:https://registry.npmmirror.com/opencode-linux-arm64-musl cache-miss 27 silly fetch manifest [email protected] 28 silly packumentCache full:https://registry.npmmirror.com/opencode-linux-x64-musl cache-miss 29 silly fetch manifest [email protected] 30 silly packumentCache full:https://registry.npmmirror.com/opencode-linux-x64-baseline-musl cache-miss 31 silly fetch manifest [email protected] 32 silly packumentCache full:https://registry.npmmirror.com/opencode-darwin-arm64 cache-miss 33 http cache https://registry.npmmirror.com/opencode-linux-x64-musl 7ms (cache hit) 34 silly packumentCache full:https://registry.npmmirror.com/opencode-linux-x64-musl set size:1348307 disposed:false 35 silly fetch manifest [email protected] 36 silly packumentCache full:https://registry.npmmirror.com/opencode-darwin-x64 cache-miss 37 http cache https://registry.npmmirror.com/opencode-linux-x64-baseline 20ms (cache hit) 38 silly packumentCache full:https://registry.npmmirror.com/opencode-linux-x64-baseline set size:3486768 disposed:false 39 silly fetch manifest [email protected] 40 silly packumentCache full:https://registry.npmmirror.com/opencode-darwin-x64-baseline cache-miss 41 http cache https://registry.npmmirror.com/opencode-linux-arm64-musl 28ms (cache hit) 42 silly packumentCache full:https://registry.npmmirror.com/opencode-linux-arm64-musl set size:1360471 disposed:false 43 silly fetch manifest [email protected] 44 silly packumentCache full:https://registry.npmmirror.com/opencode-windows-x64 cache-miss 45 http cache https://registry.npmmirror.com/opencode-linux-arm64 34ms (cache hit) 46 silly packumentCache full:https://registry.npmmirror.com/opencode-linux-arm64 set size:4933116 disposed:false 47 silly fetch manifest [email protected] 48 silly packumentCache full:https://registry.npmmirror.com/opencode-windows-x64-baseline cache-miss 49 http cache https://registry.npmmirror.com/opencode-linux-x64-baseline-musl 49ms (cache hit) 50 silly packumentCache full:https://registry.npmmirror.com/opencode-linux-x64-baseline-musl set size:1391814 disposed:false 51 http cache https://registry.npmmirror.com/opencode-darwin-arm64 55ms (cache hit) 52 silly packumentCache full:https://registry.npmmirror.com/opencode-darwin-arm64 set size:4911470 disposed:false 53 http cache https://registry.npmmirror.com/opencode-linux-x64 72ms (cache hit) 54 silly packumentCache full:https://registry.npmmirror.com/opencode-linux-x64 set size:4876259 disposed:false 55 http cache https://registry.npmmirror.com/opencode-windows-x64-baseline 35ms (cache hit) 56 silly packumentCache full:https://registry.npmmirror.com/opencode-windows-x64-baseline set size:1367467 disposed:false 57 http cache https://registry.npmmirror.com/opencode-darwin-x64-baseline 62ms (cache hit) 58 silly packumentCache full:https://registry.npmmirror.com/opencode-darwin-x64-baseline set size:3335820 disposed:false 59 http cache https://registry.npmmirror.com/opencode-windows-x64 67ms (cache hit) 60 silly packumentCache full:https://registry.npmmirror.com/opencode-windows-x64 set size:4548758 disposed:false 61 http cache https://registry.npmmirror.com/opencode-darwin-x64 98ms (cache hit) 62 silly packumentCache full:https://registry.npmmirror.com/opencode-darwin-x64 set size:4874912 disposed:false 63 silly fetch manifest [email protected] 64 silly packumentCache full:https://registry.npmmirror.com/opencode-linux-arm64 cache-miss 65 http cache https://registry.npmmirror.com/opencode-linux-arm64 22ms (cache hit) 66 silly packumentCache full:https://registry.npmmirror.com/opencode-linux-arm64 set size:4933116 disposed:false 67 silly fetch manifest [email protected] 68 silly packumentCache full:https://registry.npmmirror.com/opencode-linux-x64 cache-miss 69 http cache https://registry.npmmirror.com/opencode-linux-x64 4ms (cache hit) 70 silly packumentCache full:https://registry.npmmirror.com/opencode-linux-x64 set size:4876259 disposed:false 71 silly fetch manifest [email protected] 72 silly packumentCache full:https://registry.npmmirror.com/opencode-linux-x64-baseline cache-miss 73 http cache https://registry.npmmirror.com/opencode-linux-x64-baseline 4ms (cache hit) 74 silly packumentCache full:https://registry.npmmirror.com/opencode-linux-x64-baseline set size:3486768 disposed:false 75 silly fetch manifest [email protected] 76 silly packumentCache full:https://registry.npmmirror.com/opencode-linux-arm64-musl cache-miss 77 http cache https://registry.npmmirror.com/opencode-linux-arm64-musl 8ms (cache hit) 78 silly packumentCache full:https://registry.npmmirror.com/opencode-linux-arm64-musl set size:1360471 disposed:false 79 silly fetch manifest [email protected] 80 silly packumentCache full:https://registry.npmmirror.com/opencode-linux-x64-musl cache-miss 81 http cache https://registry.npmmirror.com/opencode-linux-x64-musl 1ms (cache hit) 82 silly packumentCache full:https://registry.npmmirror.com/opencode-linux-x64-musl set size:1348307 disposed:false 83 silly fetch manifest [email protected] 84 silly packumentCache full:https://registry.npmmirror.com/opencode-linux-x64-baseline-musl cache-miss 85 http cache https://registry.npmmirror.com/opencode-linux-x64-baseline-musl 1ms (cache hit) 86 silly packumentCache full:https://registry.npmmirror.com/opencode-linux-x64-baseline-musl set size:1391814 disposed:false 87 silly fetch manifest [email protected] 88 silly packumentCache full:https://registry.npmmirror.com/opencode-darwin-arm64 cache-miss 89 http cache https://registry.npmmirror.com/opencode-darwin-arm64 4ms (cache hit) 90 silly packumentCache full:https://registry.npmmirror.com/opencode-darwin-arm64 set size:4911470 disposed:false 91 silly fetch manifest [email protected] 92 silly packumentCache full:https://registry.npmmirror.com/opencode-darwin-x64 cache-miss 93 http cache https://registry.npmmirror.com/opencode-darwin-x64 4ms (cache hit) 94 silly packumentCache full:https://registry.npmmirror.com/opencode-darwin-x64 set size:4874912 disposed:false 95 silly fetch manifest [email protected] 96 silly packumentCache full:https://registry.npmmirror.com/opencode-darwin-x64-baseline cache-miss 97 http cache https://registry.npmmirror.com/opencode-darwin-x64-baseline 3ms (cache hit) 98 silly packumentCache full:https://registry.npmmirror.com/opencode-darwin-x64-baseline set size:3335820 disposed:false 99 silly fetch manifest [email protected] 100 silly packumentCache full:https://registry.npmmirror.com/opencode-windows-x64 cache-miss 101 http cache https://registry.npmmirror.com/opencode-windows-x64 3ms (cache hit) 102 silly packumentCache full:https://registry.npmmirror.com/opencode-windows-x64 set size:4548758 disposed:false 103 silly fetch manifest [email protected] 104 silly packumentCache full:https://registry.npmmirror.com/opencode-windows-x64-baseline cache-miss 105 http cache https://registry.npmmirror.com/opencode-windows-x64-baseline 2ms (cache hit) 106 silly packumentCache full:https://registry.npmmirror.com/opencode-windows-x64-baseline set size:1367467 disposed:false 107 silly placeDep node_modules/opencode-ai opencode-darwin-arm64@ OK for: [email protected] want: 1.1.4 108 silly placeDep node_modules/opencode-ai opencode-darwin-x64@ OK for: [email protected] want: 1.1.4 109 silly placeDep node_modules/opencode-ai opencode-darwin-x64-baseline@ OK for: [email protected] want: 1.1.4 110 silly placeDep node_modules/opencode-ai opencode-linux-arm64@ OK for: [email protected] want: 1.1.4 111 silly placeDep node_modules/opencode-ai opencode-linux-arm64-musl@ OK for: [email protected] want: 1.1.4 112 silly placeDep node_modules/opencode-ai opencode-linux-x64@ OK for: [email protected] want: 1.1.4 113 silly placeDep node_modules/opencode-ai opencode-linux-x64-baseline@ OK for: [email protected] want: 1.1.4 114 silly placeDep node_modules/opencode-ai opencode-linux-x64-baseline-musl@ OK for: [email protected] want: 1.1.4 115 silly placeDep node_modules/opencode-ai opencode-linux-x64-musl@ OK for: [email protected] want: 1.1.4 116 silly placeDep node_modules/opencode-ai opencode-windows-x64@ OK for: [email protected] want: 1.1.4 117 silly placeDep node_modules/opencode-ai opencode-windows-x64-baseline@ OK for: [email protected] want: 1.1.4 118 silly reify moves {} 119 http cache opencode-ai@https://registry.npmmirror.com/opencode-ai/-/opencode-ai-1.1.4.tgz 0ms (cache hit) 120 info run [email protected] postinstall node_modules/opencode-ai bun ./postinstall.mjs || node ./postinstall.mjs 121 info run [email protected] postinstall { code: 1, signal: null } 122 verbose stack Error: command failed 122 verbose stack at promiseSpawn (/usr/local/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:22:22) 122 verbose stack at spawnWithShell (/usr/local/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:124:10) 122 verbose stack at promiseSpawn (/usr/local/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:12:12) 122 verbose stack at runScriptPkg (/usr/local/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/run-script-pkg.js:79:13) 122 verbose stack at runScript (/usr/local/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/run-script.js:9:12) 122 verbose stack at /usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/rebuild.js:332:17 122 verbose stack at run (/usr/local/lib/node_modules/npm/node_modules/promise-call-limit/dist/commonjs/index.js:67:22) 122 verbose stack at /usr/local/lib/node_modules/npm/node_modules/promise-call-limit/dist/commonjs/index.js:84:9 122 verbose stack at new Promise () 122 verbose stack at callLimit (/usr/local/lib/node_modules/npm/node_modules/promise-call-limit/dist/commonjs/index.js:35:69) 123 verbose pkgid [email protected] 124 error code 1 125 error path /usr/local/lib/node_modules/opencode-ai 126 error command failed 127 error command sh -c bun ./postinstall.mjs || node ./postinstall.mjs 128 error Failed to setup opencode binary: Could not find package opencode-darwin-arm64: Cannot find module 'opencode-darwin-arm64/package.json' from '/usr/local/lib/node_modules/opencode-ai/postinstall.mjs' 128 error Failed to setup opencode binary: Could not find package opencode-darwin-arm64: Cannot find module 'opencode-darwin-arm64/package.json' 128 error Require stack: 128 error - /usr/local/lib/node_modules/opencode-ai/postinstall.mjs 129 silly unfinished npm timer reify 1767754031950 130 silly unfinished npm timer reify:build 1767754032237 131 silly unfinished npm timer build 1767754032238 132 silly unfinished npm timer build:deps 1767754032238 133 silly unfinished npm timer build:run:postinstall 1767754032238 134 silly unfinished npm timer build:run:postinstall:node_modules/opencode-ai 1767754032238 135 verbose cwd /Users/rao 136 verbose os Darwin 24.3.0 137 verbose node v24.12.0 138 verbose npm v11.6.2 139 verbose exit 1 140 verbose code 1 141 error A complete log of this run can be found in: /Users/rao/.npm/_logs/2026-01-07T02_47_11_755Z-debug-0.log

MuJianxuan avatar Jan 07 '26 02:01 MuJianxuan

You need to use a different registry for downloading: npm install -g opencode-ai --registry=https://registry.npmjs.org

dannywsh avatar Jan 07 '26 02:01 dannywsh

You need to use a different registry for downloading: npm install -g opencode-ai --registry=https://registry.npmjs.org

thanks you! 是这样

MuJianxuan avatar Jan 07 '26 02:01 MuJianxuan

laster

Faker-Lost avatar Jan 14 '26 10:01 Faker-Lost