EBADPLATFORM on ubuntu via WSL

Status Fixed / completed
Maintainer reply ✓ Yes — ashwin-ant
Activity 6 comments · opened Feb 26, 2025 · closed Feb 26, 2025
💡 Likely answer: A maintainer (ashwin-ant, collaborator) responded on this thread — see the highlighted reply below.

Trying to install claude code via:

``npm install -g @anthropic-ai/claude-code``

And getting this error:

npm install -g @anthropic-ai/claude-code
npm error code EBADPLATFORM
npm error notsup Unsupported platform for @anthropic-ai/claude-code@0.2.14: wanted {"os":"!win32"} (current: {"os":"win32"})
npm error notsup Valid os:  !win32
npm error notsup Actual os: win32
npm error A complete log of this run can be found in: C:\Users\lenovo\AppData\Local\npm-cache\_logs\2025-02-26T02_05_21_879Z-debug-0.log

2025-02-26T02_05_21_879Z-debug-0.log

View original on GitHub ↗

6 Comments

patched-admin · 1 year ago

I am facing the same error.

rp1231 · 1 year ago

The error is due to wsl using the node installed on windows.
It should detect that WSL is being used and allow it?
Hopefully this is fixed soon.

ashwin-ant collaborator · 1 year ago

@rp1231 please see the discussion in https://github.com/anthropics/claude-code/issues/107. There are some steps there that you can take to troubleshoot. If none of the suggestions there work, feel free to reopen this issue.

And thanks for reporting! We'll work on updating our docs to clarify this.

patched-admin · 1 year ago

Doesn't solve it @ashwin-ant - tried setting npm os to linux, also tried powershell. Still getting the error AppData/Roaming/npm/claude: 15: exec: node: not found when running claude.

UPDATE: @ashwin-ant reinstalling nvm did the trick for me.

ashwin-ant collaborator · 1 year ago

Awesome! Sounds like it may have been a Windows build of nvm or something.

github-actions[bot] · 1 year ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.