Skip to content

Bug: scoop falsely detected as installation method when nodejs is installed via scoop #34734

Closed as not planned

Description

@ogerardin

Description

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:

C:\Users\<user>\scoop\apps\nodejs-lts\current\bin\node_modules\opencode-ai\bin\opencode.exe

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():
const output = yield* check.command() // scoop list opencode
const installedName = check.name === "scoop" ? "opencode" : "opencode-ai"
if (output.includes(installedName)) {  // always true due to header line
  return check.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 results
const lines = 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

  1. github-actions commented on Jul 1, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

  2. ogerardin commented on Jul 1, 2026

    @ogerardin
    Author

    This issue might be a duplicate of existing issues. Please check:

    This is not the same issue

  3. github-actions commented on Aug 31, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions