claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

Unsupported win32?

Open PyLuaDebugger opened this issue 1 year ago • 13 comments

npm install -g @anthropic-ai/claude-code npm error code EBADPLATFORM npm error notsup Unsupported platform for @anthropic-ai/[email protected]: wanted {"os":"!win32"} (current: {"os":"win32"}) npm error notsup Valid os: !win32 npm error notsup Actual os: win32

PyLuaDebugger avatar Feb 26 '25 03:02 PyLuaDebugger

same too :

npm error code EBADPLATFORM
npm error notsup Unsupported platform for @anthropic-ai/[email protected]: wanted {"os":"!win32"} (current: {"os":"win32"})
npm error notsup Valid os:  !win32
npm error notsup Actual os: win32

Ubuntu 22.04 WSL

namnt90 avatar Feb 26 '25 03:02 namnt90

same:

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

npm ERR! code EBADPLATFORM

npm ERR! notsup Unsupported platform for @anthropic-ai/[email protected]: wanted {"os":"!win32"} (current: {"os":"win32"})

npm ERR! notsup Valid os: !win32

npm ERR! notsup Actual os: win32

JoshuaJDevine avatar Feb 26 '25 04:02 JoshuaJDevine

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

bcherny avatar Feb 26 '25 06:02 bcherny

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

bcherny avatar Feb 26 '25 06:02 bcherny

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

Moramor avatar Feb 26 '25 11:02 Moramor

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

IcodeNet avatar Feb 26 '25 12:02 IcodeNet

(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)

taupirho avatar Feb 26 '25 17:02 taupirho

@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

ashwin-ant avatar Feb 26 '25 17:02 ashwin-ant

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

taupirho avatar Feb 26 '25 17:02 taupirho

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

taupirho avatar Feb 26 '25 17:02 taupirho

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

Gyarados avatar Feb 26 '25 20:02 Gyarados

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.

bcherny avatar Feb 26 '25 22:02 bcherny

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.

github-actions[bot] avatar Aug 09 '25 14:08 github-actions[bot]