Unsupported win32?

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

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

View original on GitHub ↗

13 Comments

namnt90 · 1 year ago

same too :

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

Ubuntu 22.04 WSL

JoshuaJDevine · 1 year ago

same:

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

npm ERR! code EBADPLATFORM

npm ERR! notsup Unsupported platform for @anthropic-ai/claude-code@0.2.14: wanted {"os":"!win32"} (current: {"os":"win32"})

npm ERR! notsup Valid os: !win32

npm ERR! notsup Actual os: win32

bcherny collaborator · 1 year ago

Windows is not supported, but WSL on Windows is supported. Are all the folks running into this using WSL?

bcherny collaborator · 1 year ago

Closing, but please feel free to re-open if you've confirmed you're running into this using WSL.

Moramor · 1 year ago

I have the same problem, on WSL 2 Ubuntu 24-04 LTS with windows 10 Pro 64 Bits

IcodeNet · 1 year ago

Same here

Version: 0.46.4 (user setup)
VSCode Version: 1.96.2
Commit: db71624816f6d52f6e54f47c37cdc7df23e22620
Date: 2025-02-25T07:37:34.169Z
Electron: 32.2.6
Chromium: 128.0.6613.186
Node.js: 20.18.1
V8: 12.8.374.38-electron.0
OS: Windows_NT x64 10.0.26100

$ wsl --status
Default Distribution: Ubuntu
Default Version: 2

!Image

eventually I managed to install it running the following command

npm install -g @anthropic-ai/claude-code --force --no-os-check
taupirho · 1 year ago

(base) tom@tpr-desktop:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.5 LTS
Release: 22.04
Codename: jammy
(base) tom@tpr-desktop:~$ node --version
v12.22.9
(base) tom@tpr-desktop:~$ npm --version
11.1.0
(base) tom@tpr-desktop:~$

I ran the suggested command to force installation (on WSL2 for Windows)

npm install -g @anthropic-ai/claude-code --force --no-os-check

And it seemed to install without error. However when I ran claude I got this
...
...
...
stacktrace!=="undefined"||typeof E["opera#sourceloc"]!=="undefined")return this.parseOpera(E);else if(E.stack&&E.stack.match(J))return this.parseV8OrIE(E);else if(E.stack)return this.parseFFOrSafari(E);else throw new Error("Cannot parse given Error object")},extractLocation:function Q(E){if(E.indexOf(":")===-1)return[E];var S=/(.+?)(?::(\d+))?(?::(\d+))?$/,$=S.exec(E.replace(/[()]/g,""));return[$[1],$[2]||void 0,$[3]||void 0]},parseV8OrIE:function Q(E){var S=E.stack.split(`

^

SyntaxError: Unexpected token '='
at Loader.moduleStrategy (internal/modules/esm/translators.js:133:18)
at async link (internal/modules/esm/module_job.js:42:21)

ashwin-ant collaborator · 1 year ago

@taupirho please run:

which npm
which node
which nvm # if you're using nvm

In particular I'd like to make sure your npm and node installations are actually Linux builds, not Windows builds. Some more info in this issue: https://github.com/anthropics/claude-code/issues/107

taupirho · 1 year ago

(base) tom@tpr-desktop:~$ which npm
which node
/mnt/c/Program Files/nodejs/npm
/usr/bin/node
(base) tom@tpr-desktop:~$

taupirho · 1 year ago

Thanks for the tip, yes I needed to install node nativley on WSL2. Here's how:

$ sudo apt-get update
$ # Install curl if you don't have it
$ sudo apt-get install curl
$ # Install nvm
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash
$ # Use nvm to install node
$ nvm install --lts

Gyarados · 1 year ago

That fixed it for me too. I followed the instructions to install node in WSL here: https://learn.microsoft.com/en-us/windows/dev-environment/javascript/nodejs-on-wsl#install-nvm-nodejs-and-npm

bcherny collaborator · 1 year ago

The newest version (v0.2.18) has improved instructions for WSL usage. Closing this out -- feel free to open a new issue if you get stuck.

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.