Claude Code 1.0.xInstall
Claude Code: install fails on WSL (npm OS mismatch)
npm error notsup Unsupported platform — wanted {"os":"linux"} (current: {"os":"win32"})- Affected versions
- 1.0.x
- Fixed in
- —
- Last verified
- Claude Code 1.0.x
Root cause
Inside WSL, npm sometimes detects the Windows OS (or a Windows-installed Node is shadowing the Linux one), so platform-specific packages refuse to install.
How to reproduce
Install Claude Code inside WSL2 Ubuntu and hit an OS/platform mismatch error.
Solutions (2)
Ordered by community votes. Always check the verified version before applying.
41
#1Applies to 1.0.x
Tell npm to behave as Linux before installing: `npm config set os linux`, then install Claude Code again inside WSL.
Last verified: Claude Code 1.0.x · community
22
#2Applies to 1.0.x
Make sure you're using the Linux Node (installed inside WSL via nvm), not the Windows Node on PATH. Check with `which node` and `which npm`.
Last verified: Claude Code 1.0.x · community