The symptoms
Install fails with npm errors
npm throws EACCES, EEXIST, or a build error partway through the global install.
'command not found' after install
It installs, but the terminal can't find the command — a PATH problem.
Crashes or exits immediately
It starts, then quits with a Node error — usually a version mismatch or wrong environment.
Fix 1 — get Node/npm right
A too-old (or mismatched) Node is the number-one cause. Install a current Node LTS, confirm the version, then reinstall the CLI globally so it builds against the right runtime.
node -v # should be a current LTS
npm -v
# reinstall the CLI globally after upgrading Node
npm i -g @anthropic-ai/claude-codeFix 2 — fix PATH ('command not found')
If it installs but the command isn't found, the global npm bin folder isn't on your PATH. Find where npm puts global binaries and make sure that folder is on PATH, then open a fresh terminal.
npm config get prefix # global install location
# add the resulting \bin (or the folder itself on Windows) to your PATH,
# then open a NEW terminal so the change takes effectFix 3 — native Windows vs WSL
A lot of Windows friction disappears inside WSL, where the Unix-style tooling Claude Code expects just works. If native Windows keeps fighting you (permissions, PATH, shell quirks), install and run it inside a WSL Ubuntu instead. Make sure you install Node inside WSL, not reuse the Windows one.
Fix 4 — permissions
EACCES/permission errors during a global install mean npm can't write to its global folder. Rather than running everything as admin, point npm's global prefix at a folder you own, or use a Node version manager that keeps everything under your user profile.
Still stuck?
If you've been through Node, PATH, WSL and permissions and it still won't behave, it may be worth trying a client that doesn't depend on a global npm install and a specific shell setup at all. A self-contained desktop agent installs like a normal app and runs the same loop — you bring a model key and go, without the Node/PATH/WSL scavenger hunt.
FAQ
Why does Claude Code say 'command not found' after installing?
The global npm bin folder isn't on your PATH. Run 'npm config get prefix' to find where global packages install, add that bin folder to PATH, and open a new terminal.
Should I run Claude Code on native Windows or WSL?
WSL is usually smoother — the Unix tooling it expects works out of the box. Just install Node inside WSL and don't mix it with a Windows Node install.
How do I fix EACCES permission errors on install?
npm can't write to its global folder. Set npm's global prefix to a directory you own, or use a Node version manager under your user profile, instead of installing globally as admin.