Fix "openclaw is not recognized" on Windows (PATH Fix)
A deep-dive on the Windows error openclaw : The term 'openclaw' is not recognized. Part of the OpenClaw troubleshooting hub.
Stuck on this? Get 1:1 OpenClaw help
Remote rescue for Windows, WSL2, PATH, and PowerShell setup problems. See the rescue session →
If PowerShell says openclaw : The term 'openclaw' is not recognized, the install worked but Windows can’t find the command because npm’s global bin directory isn’t on your PATH. The fix is to add %AppData%\npm to your user PATH and open a new terminal. This page covers that, plus the related “garbled text” output problem on Windows.
openclaw : The term 'openclaw' is not recognized as the name of a cmdlet, function, script file, or operable program.
Why this happens
npm install -g openclaw puts the openclaw executable in npm’s global bin directory. On Windows that’s usually %AppData%\npm (i.e. C:\Users\<you>\AppData\Roaming\npm). Windows only finds commands in folders listed on your PATH environment variable. If that npm folder isn’t on PATH, the shell searches, finds nothing, and throws the “not recognized” error, even though the file is right there on disk. This is a PATH problem, not a broken install.
The fix: add the npm global bin to PATH
1. Confirm the folder
npm prefix -g
The openclaw command lives in that folder (on Windows, directly in it; the value is typically %AppData%\npm).
2. Add it to your user PATH
- Press Start, search Environment Variables, open Edit the system environment variables.
- Click Environment Variables…
- Under User variables, select Path and click Edit.
- Click New and add
%AppData%\npm(or the exact path from step 1). - Click OK on every dialog.
3. Open a NEW PowerShell window
PATH is read when a shell starts, so your current window still has the old value. Close it, open a fresh PowerShell, and verify:
openclaw --version
If that prints a version, you’re done.
WSL2 users: if you installed OpenClaw inside WSL2 instead, the PATH lives in Linux, not Windows. Add
export PATH="$(npm prefix -g)/bin:$PATH"to your~/.bashrc. Full walkthrough in the OpenClaw Windows setup guide.
Bonus: garbled text in PowerShell
If OpenClaw runs but the output is full of broken box characters or mojibake, PowerShell isn’t using UTF-8. Fix the console encoding and restart the gateway:
chcp 65001 [Console]::InputEncoding = [System.Text.UTF8Encoding]::new($false) [Console]::OutputEncoding = [System.Text.UTF8Encoding]::new($false) openclaw gateway restart
Quick reference
| Symptom | Cause | Fix |
|---|---|---|
not recognized as a cmdlet | npm global bin not on PATH | Add %AppData%\npm to PATH |
| Still not found after PATH edit | Old shell has stale PATH | Open a new PowerShell window |
| Garbled / box-drawing output | Console not UTF-8 | chcp 65001 + UTF8 encoding |
Related OpenClaw guides
- Back to the full OpenClaw troubleshooting hub for all errors.
- Full Windows install (WSL2 vs native): OpenClaw on Windows setup guide.
- Gateway starts but auth fails? See gateway token missing / 1008 unauthorized.
- Browser tools can’t find the extension? See bundled Chrome extension is missing.
Need help?
If OpenClaw still won’t run on Windows after fixing PATH, we offer a fixed-scope remote rescue session. See OpenClaw troubleshooting help →
Get guides like this in your inbox every Wednesday.
No spam. Unsubscribe anytime.
You'll probably need this again.
Press Cmd+D (Mac) or Ctrl+D (Windows) to bookmark this page.
Need OpenClaw fixed live?
Remote rescue sessions for gateway, auth, tunnel, VPS, and model access problems.
See Rescue Session