Rescue OpenClaw stuck? Gateway, auth, tunnel, and VPS troubleshooting. Get help →
← Back to Blog

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

  1. Press Start, search Environment Variables, open Edit the system environment variables.
  2. Click Environment Variables…
  3. Under User variables, select Path and click Edit.
  4. Click New and add %AppData%\npm (or the exact path from step 1).
  5. 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 cmdletnpm global bin not on PATHAdd %AppData%\npm to PATH
Still not found after PATH editOld shell has stale PATHOpen a new PowerShell window
Garbled / box-drawing outputConsole not UTF-8chcp 65001 + UTF8 encoding

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

Next useful step

Read next

Fix OpenClaw "Bundled Chrome Extension Is Missing"
Fix the OpenClaw error "bundled Chrome extension is missing". Install the extension files, find the folder path, and load it unpacked in Chrome Developer mode.
Fix OpenClaw Docker "Missing config" / Gateway Won't Start
Fix the OpenClaw Docker error "Missing config. Run openclaw setup or set gateway.mode=local". Initialize gateway.mode, gateway.bind, and restart the container.
Fix OpenClaw macOS: Gateway Won't Stay Running / Telegram Bot Silent
Fix OpenClaw on macOS: gateway dies when you close the terminal, and the Telegram bot stops responding. Install the launchd service and fix binding + permissions.