You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: scoop falsely detected as installation method when nodejs is installed via scoop #34734
opencode upgrade incorrectly detects scoop as the installation method when opencode is installed via npm but Node.js itself is installed via scoop.
Environment
OS: Windows
opencode version: 1.17.3
Installation method: npm install -g opencode-ai
Node.js installation: via scoop (scoop install nodejs-lts)
Root Cause
Two compounding issues in packages/opencode/src/installation/index.ts:
1. Exec path sort puts scoop first
The detection sorts package managers by whether their name appears in process.execPath. Because Node.js is installed via scoop, the opencode binary resolves to a path like:
This path contains scoop, so scoop is sorted to the front of the check list before npm.
2. scoop list opencode always outputs "opencode" in its header
scoop list opencode returns the following even when opencode is not installed via scoop:
Installed apps matching 'opencode':
The detection code checks output.includes("opencode"), which matches this header string regardless of whether any packages are listed. This causes a false positive: scoop is returned as the detected method even though opencode is not managed by scoop.
// In method():constoutput=yield*check.command()// scoop list opencodeconstinstalledName=check.name==="scoop" ? "opencode" : "opencode-ai"if(output.includes(installedName)){// always true due to header linereturncheck.name// incorrectly returns "scoop"}
Verification
$ scoop list opencode
Installed apps matching 'opencode':
# (no entries - scoop does NOT manage opencode)
$ npm list -g --depth=0 | grep opencode
+-- [email protected]# npm IS managing opencode
Expected Behavior
opencode should detect npm as the installation method.
Actual Behavior
opencode upgrade attempts to upgrade via scoop (scoop install opencode@<version>) instead of npm (npm install -g opencode-ai@<version>).
Suggested Fix
For the scoop check, skip the header line before testing for a match:
// scoop list always emits: "Installed apps matching 'opencode':"// filter that header out before checking for actual resultsconstlines=output.split("\n").filter(l=>!l.startsWith("Installed apps matching"))if(lines.some(l=>l.includes("opencode")))return"scoop"
Alternatively, prefer npm over scoop when npm list -g confirms opencode-ai is installed — a package named opencode-ai can only come from npm, not scoop.
Activity
github-actions commentedon Jul 1, 2026
This issue might be a duplicate of existing issues. Please check:
process.execPathreflects the runtime (Node/Bun) path rather than the opencode CLI path, leading to the wrong installer being selected.ogerardin commentedon Jul 1, 2026
This is not the same issue
github-actions commentedon Aug 31, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.