我的电脑是Windows环境 使用npm包的形式安装opencode出现如图的错误 #4601

Open
opened 2026-02-16 17:44:45 -05:00 by yindo · 5 comments
Owner

Originally created by @IT-axiosjj on GitHub (Jan 10, 2026).

Originally assigned to: @rekram1-node on GitHub.

Question

Image C:\Users\86150>opencode It seems that your package manager failed to install the right version of the opencode CLI for your platform. You can try manually installing the "opencode-windows-x64" package
Originally created by @IT-axiosjj on GitHub (Jan 10, 2026). Originally assigned to: @rekram1-node on GitHub. ### Question <img width="815" height="571" alt="Image" src="https://github.com/user-attachments/assets/5e45bc74-6acf-4be8-a323-0cc835028c7f" /> C:\Users\86150>opencode It seems that your package manager failed to install the right version of the opencode CLI for your platform. You can try manually installing the "opencode-windows-x64" package
yindo added the windows label 2026-02-16 17:44:45 -05:00
Author
Owner

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

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

  • #3002: It seems that your package manager failed to install the right version of the opencode CLI for your platform. You can try manually installing the "opencode-windows-x64" package (exact same error message)
  • #5476: Bad experience installing OpenCode for Windows (Windows npm installation issues)

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

@github-actions[bot] commented on GitHub (Jan 10, 2026): This issue might be a duplicate of existing issues. Please check: - #3002: It seems that your package manager failed to install the right version of the opencode CLI for your platform. You can try manually installing the "opencode-windows-x64" package (exact same error message) - #5476: Bad experience installing OpenCode for Windows (Windows npm installation issues) Feel free to ignore if none of these address your specific case.
Author
Owner

@Cansiny0320 commented on GitHub (Jan 11, 2026):

用 npm 官方源下载,别用镜像源 Download from npm official source, not mirror source
npm config set registry https://registry.npmjs.org

@Cansiny0320 commented on GitHub (Jan 11, 2026): 用 npm 官方源下载,别用镜像源 Download from npm official source, not mirror source npm config set registry https://registry.npmjs.org
Author
Owner

@LonExplorer-coder commented on GitHub (Jan 12, 2026):

用 npm 官方源下载,别用镜像源 npm config set registry https://registry.npmjs.org

解决了我的问题!

@LonExplorer-coder commented on GitHub (Jan 12, 2026): > 用 npm 官方源下载,别用镜像源 npm config set registry https://registry.npmjs.org 解决了我的问题!
Author
Owner

@DejvyK commented on GitHub (Jan 18, 2026):

I found that windows opencode doesn't work if I have activated Conda. even when i did

npm config set registry https://registry.npmjs.org/
npm install -g opencode-windows-x64 --registry https://registry.npmjs.org
npm install -g opencode-ai --registry https://registry.npmjs.org

conda deactivation worked for me and now it works flawlessly.

@DejvyK commented on GitHub (Jan 18, 2026): I found that windows opencode doesn't work if I have activated Conda. even when i did npm config set registry https://registry.npmjs.org/ npm install -g opencode-windows-x64 --registry https://registry.npmjs.org npm install -g opencode-ai --registry https://registry.npmjs.org conda deactivation worked for me and now it works flawlessly.
Author
Owner

@QiaoXi-MuXi commented on GitHub (Jan 18, 2026):

npm install -g opencode-windows-x64 --registry https://registry.npmjs.org/
这个命令完美解决了我的报错问题,非常感谢!!!

@QiaoXi-MuXi commented on GitHub (Jan 18, 2026): > npm install -g opencode-windows-x64 --registry https://registry.npmjs.org/ 这个命令完美解决了我的报错问题,非常感谢!!!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#4601