After installing OpenCode, it cannot be used. Solution #6758

Open
opened 2026-02-16 18:05:10 -05:00 by yindo · 3 comments
Owner

Originally created by @cm0201 on GitHub (Jan 19, 2026).

Originally assigned to: @adamdotdevin on GitHub.

Question

In Windows 11, when installing opencode, there are situations where it cannot be used.

For example:
In the cmd, enter "opencode", but there is no response.
In the cmd, enter "opencode web". Error message:

  • Can't import "@openauthjs/openauth/pkce"
  • Can't import "../../lib/skills-core.js"
    OpenCode Desktop encountered an error during operation.

Solution:

  1. Uninstall opencode (npm un -g opencode-ai)
  2. Delete the folder (.config/opencode)
  3. Reinstall Opencode (npm i -g opencode-ai)

(亲测有效,解决本人2台电脑)

Originally created by @cm0201 on GitHub (Jan 19, 2026). Originally assigned to: @adamdotdevin on GitHub. ### Question In Windows 11, when installing opencode, there are situations where it cannot be used. For example: In the cmd, enter "opencode", but there is no response. In the cmd, enter "opencode web". Error message: - Can't import "@openauthjs/openauth/pkce" - Can't import "../../lib/skills-core.js" OpenCode Desktop encountered an error during operation. Solution: 1. Uninstall opencode (npm un -g opencode-ai) 2. Delete the folder (.config/opencode) 3. Reinstall Opencode (npm i -g opencode-ai) (亲测有效,解决本人2台电脑)
yindo added the windowsweb labels 2026-02-16 18:05:10 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 19, 2026):

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

  • #7631: Windows cannot use OpenCode, displaying an error message (similar Windows installation issues)
  • #6935: Windows: OpenCode fails to start - Cannot find module '@openauthjs/openauth/pkce' (same @openauthjs/openauth/pkce import error)
  • #9084: opencode wont open after install (same @openauthjs/openauth/pkce error on fresh install)
  • #3350: Error: cannot find module opencode-copilot-auth (similar module not found issues)

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Jan 19, 2026): This issue might be a duplicate of existing issues. Please check: - #7631: Windows cannot use OpenCode, displaying an error message (similar Windows installation issues) - #6935: Windows: OpenCode fails to start - Cannot find module '@openauthjs/openauth/pkce' (same @openauthjs/openauth/pkce import error) - #9084: opencode wont open after install (same @openauthjs/openauth/pkce error on fresh install) - #3350: Error: cannot find module opencode-copilot-auth (similar module not found issues) Feel free to ignore if none of these address your specific case.
Author
Owner

@neriousy commented on GitHub (Jan 19, 2026):

Are you using any plugins?

@neriousy commented on GitHub (Jan 19, 2026): Are you using any plugins?
Author
Owner

@YuanandWen commented on GitHub (Jan 19, 2026):

帮大忙了,非常感谢!

@YuanandWen commented on GitHub (Jan 19, 2026): 帮大忙了,非常感谢!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#6758