Fix: "openclaw not found" on PATH (Every Variant Solved, 2026)
The install finished, the command doesn't exist, and the error wording is different on every machine. The fix for each version of it.
You ran the install. It said success. You typed openclaw and got this:
openclaw: command not foundOr this:
'openclaw' is not recognized as an internal or external commandOr, if you watched the installer closely, this warning that scrolled past:
WARN installed, but openclaw is not discoverable on PATH in this shellThese are all the same problem wearing different clothes. The package installed fine. Your shell just doesn't know where to find it. This post is the fix for every shell and OS, plus the sneaky version where the command works today and vanishes after a reboot.
If you're mid-setup, this is the snag in Step 1 of the main guide. Clear it here and go back.
Why this happens
npm install -g puts the openclaw command in npm's global bin directory. Your shell finds commands by walking through the folders listed in your PATH variable. If npm's global bin folder isn't on that list, the command exists on disk but the shell can't see it. Nothing is broken. The map just doesn't include the right address.
So the whole fix is to find where npm put the command, then make sure that folder is on your PATH.
First, confirm it's really a PATH issue
Run this:
npm prefix -gThat prints npm's global root, something like /usr/local or /Users/you/.npm-global. The command lives in the bin folder underneath it. Check that it's actually there:
ls "$(npm prefix -g)/bin" | grep openclawIf openclaw shows up in that list, the install is fine and you have a PATH problem, so keep reading. If it doesn't show up at all, the install itself failed, and the fix is to reinstall rather than to chase PATH (skip to the last section).
macOS and Linux (zsh)
zsh is the default on modern macOS. Add npm's global bin to your PATH and reload:
echo 'export PATH="$(npm prefix -g)/bin:$PATH"' >> ~/.zshrc
source ~/.zshrcNow openclaw should resolve. This is the exact fix from the main guide, and it's the one most people need.
macOS and Linux (bash)
If your shell is bash, the same line goes in a different file. Use ~/.bashrc on Linux, ~/.bash_profile on macOS:
# Linux
echo 'export PATH="$(npm prefix -g)/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
# macOS with bash
echo 'export PATH="$(npm prefix -g)/bin:$PATH"' >> ~/.bash_profile
source ~/.bash_profileNot sure which shell you're in? Run echo $SHELL. If it ends in zsh, use the zsh steps above. If it ends in bash, use these.
Windows (PowerShell)
On Windows the global packages land in your AppData roaming folder. Confirm npm can see the directory:
npm config get prefixThat usually returns something like C:\Users\You\AppData\Roaming\npm. If typing openclaw gives you "not recognized," that folder isn't on your PATH. Add it through System Properties, Environment Variables, edit Path, and add the npm folder. Then close and reopen PowerShell completely. PowerShell only reads PATH at launch, so a fresh window is required.
If you installed through WSL2 rather than native Windows, you're actually in a Linux shell. Use the zsh or bash steps above, not this one.
The version where it works, then breaks after reboot
This one fools people. The command works right after you fix PATH, then stops working tomorrow. That means your PATH edit didn't persist, or you added it to a file your shell doesn't read on login.
Two things to check.
First, make sure the export line is in the file your shell actually loads at startup, not one you only sourced once by hand. zsh reads ~/.zshrc. Login bash reads ~/.bash_profile on macOS and ~/.bashrc on most Linux. If you put the line in the wrong file, it works in your current session and is gone after a reboot.
Second, if you're running OpenClaw as a background daemon (the --install-daemon flag from the main guide), the daemon doesn't necessarily inherit your interactive shell's PATH. The interactive command can resolve fine while the service can't find its own binary. In that case, point the daemon at the full path. Get it with:
which openclaw
# e.g. /Users/you/.npm-global/bin/openclawThen use that absolute path in the service definition rather than the bare openclaw command.
Still nothing? It's the install, not the PATH
If ls "$(npm prefix -g)/bin" never showed openclaw, no amount of PATH editing will help, because there's nothing to find. Reinstall cleanly:
npm uninstall -g openclaw
npm install -g openclaw@latestTwo common reasons the first install didn't take. Node might be too old: OpenClaw needs Node.js 22.19 or newer, with 24 recommended, so check with node --version and upgrade before reinstalling if you're below it. Or permissions silently blocked the global write: if the install threw EACCES errors you scrolled past, npm couldn't write to its global folder, so either point npm's prefix at a folder you own or rerun with the right permissions for your setup.
After a clean reinstall, run the verify command from the main guide:
openclaw doctorIf doctor runs, you're back in business. Head to Step 2 and finish the setup.
The 30-second checklist
npm prefix -gto find npm's global rootls "$(npm prefix -g)/bin" | grep openclawto confirm the command exists on diskIf it exists: add
"$(npm prefix -g)/bin"to PATH in your shell's startup file, thensourceitIf it doesn't exist: check
node --versionis 22.19+ (24 recommended), then reinstallDaemon can't find it but your shell can: use the absolute path from
which openclaw
Frequently asked questions
I fixed PATH and the command works, but openclaw doctor reports problems
Different issue. PATH got you to the command. doctor is now checking your config, which is the next thing to sort out. That's a setup question, not a PATH one.
Do I need to redo this every update?
No. Updating with npm update -g openclaw reuses the same global bin folder, so once PATH is fixed it stays fixed.
Connection errors after install?
Those aren't PATH problems, they're usually the LM Studio link. The /v1, Docker, and "no model loaded" failures are covered in the FAQ at the bottom of the main setup guide.
Sources and further reading
The setup this unblocks: How to Set Up OpenClaw with LM Studio
OpenClaw install docs:
openclaw.ai/install
Bookmark this one. PATH problems come back the next time you set up a tool, and the fix is the same few moves every time.


