Skip to content

Windows: opencode CLI hangs at startup when running internal npm list / npm config get registry #11657

@nightmarewalker

Description

@nightmarewalker

Description

Description

On one Windows 11 machine, OpenCode CLI hangs at startup when it runs internal npm commands.
The process gets stuck while executing npm list, and after manually installing the package,
it proceeds to hang at npm config get registry.

The npm commands themselves work perfectly when executed manually.
The CLI does not crash or show an error — it hangs indefinitely.

This happens consistently on this machine, but another Windows 11 PC with a very similar setup works without any issues.


Reproduction steps

  1. Windows 11

  2. Node.js via fnm (tested with Node v22.22.0, npm v10.9.4)

  3. Run: npx opencode-ai@latest

  4. Confirm installation

  5. CLI hangs during startup (window title shows npm list)

Same behavior also occurs with:

  • winget-installed opencode.exe
  • npm install -g opencode-ai@latest

After global install, the hang progresses to:

npm config get registry


Expected behavior

The CLI should either:

  • start normally, or
  • fail with a visible error message

It should not hang indefinitely during startup.


Observed behavior

  • The CLI hangs silently during startup
  • The window title shows npm list or npm config get registry
  • No error output is shown
  • The process must be terminated manually

Additional investigation results

  • npm list and npm config get registry both exit normally when run manually
  • The issue occurs in:
    • PowerShell 5.1
    • PowerShell 7.4
    • cmd.exe
  • Environment variables such as:
    • NPM_CONFIG_PROGRESS=false
    • FORCE_COLOR=0
      did not change the behavior
  • Desktop version of OpenCode works fine on the same machine
  • The issue reproduces with:
    • winget binary
    • npx
    • global npm install
  • Another Windows 11 PC with a similar setup does not reproduce the issue

Environment

  • OS: Windows 11
  • Node.js: v22.22.0
  • npm: v10.9.4
  • Node manager: fnm
  • Installation methods tested:
    • winget
    • npx
    • npm global install

Notes

This seems related to how the CLI spawns npm processes on Windows during startup checks.
The fact that:

  • npm works correctly when run manually
  • desktop app works
  • the issue occurs across multiple installation methods

suggests a Windows-specific child process / stdio handling issue during npm execution.

Plugins

No response

OpenCode version

1.1.48

Steps to reproduce

Steps to reproduce

  1. Windows 11
  2. Install OpenCode CLI via winget:
    winget install SST.opencode
  3. Run
    opencode
  4. The CLI hangs during startup (window title shows npm list)

Screenshot and/or share link

No response

Operating System

Windows 11 25H2

Terminal

Windows Terminal

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingperfIndicates a performance issue or need for optimizationwindows

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions