# OpenClaw command not found after npm install? Check PATH

Canonical: https://cwyn.com/pages/openclaw-guide-command-not-found-after-npm-install.html
Last updated: 2026-11-26T23:37:05-05:00

OpenClaw operations guide

Run `npm prefix -g` in the terminal that cannot find OpenClaw. Look for the launcher in the prefix’s bin directory on macOS or Linux, or directly in the prefix on Windows. If the launcher prints a version by its full path, add its directory to PATH and try `openclaw --version` in a fresh terminal.

Last updated November 26, 2026 · Published November 19, 2026

Tested on OpenClaw 2026.11.10 (Nov 25, 2026). On a clean install, `openclaw --version` printed `OpenClaw 2026.11.10 (6ea542f)`.

By CWYN · Nov 26, 2026 · Checked against docs, not run · [OpenClaw Node installation reference](https://raw.githubusercontent.com/openclaw/openclaw/v2026.11.5/docs/install/node.md)

## 1. Find the npm prefix for this terminal

In the terminal reporting `zsh: command not found: openclaw`, run `npm prefix -g`, then `npm ls -g --depth=0 openclaw`. The first prints a directory. The second should show OpenClaw and its installed version. If npm itself is missing, start with the [Node.js installation guide](https://docs.openclaw.ai/install/node).

## 2. Check that the launcher exists

On macOS or Linux, run `"$(npm prefix -g)/bin/openclaw" --version`. In PowerShell, run `& (Join-Path (npm prefix -g) 'openclaw.cmd') --version`. A version here means the launcher works. If the file is missing, check which Node version manager, OS account or WSL environment you used for the install. A package listed under a different prefix belongs to that environment. If the package is in Ubuntu on Windows, [continue the WSL2 installation](https://cwyn.com/pages/openclaw-guide-windows-wsl2-install.html) in that distribution.

## 3. Try the directory in this shell first

In zsh or Bash, run `export PATH="$(npm prefix -g)/bin:$PATH"`. In PowerShell use `$env:Path = "$(npm prefix -g);$env:Path"`. Windows keeps npm’s launchers directly in the prefix. Run `openclaw --version` again. If PowerShell now reports a script execution policy error, try `openclaw.cmd --version` to check the command shim.

## 4. Keep the working path for new terminals

If the temporary change worked, add the same export to the startup file your interactive shell reads, after any Node version manager setup. For zsh this is usually `~/.zshrc`. On Windows add the directory printed by `npm prefix -g` to your user Path in Environment Variables. Keep the existing entries.

## 5. Check which copy wins in a fresh shell

Close the test terminal and open another. Run `command -v openclaw` in zsh or Bash, or `where.exe openclaw` on Windows. The first match should belong to the install you checked. Run its version command once more. If a different copy wins, correct the order of the two entries before you run onboarding.

If the CLI opens but a command waits for permission, [check for a pending exec approval](https://cwyn.com/pages/openclaw-guide-exec-approval-stuck.html).

[Get your free CWYN Score](https://cwyn.com/score)

## Related guides

- [OpenClaw Gateway port 18789 is already in use](https://cwyn.com/pages/openclaw-guide-gateway-port-already-in-use.html)
- [OpenClaw SERVICE_DEFINITION_UNKNOWN on Windows](https://cwyn.com/pages/openclaw-guide-windows-gateway-scheduled-task-unknown.html)
- [Uninstall OpenClaw and reinstall it cleanly](https://cwyn.com/pages/openclaw-guide-clean-reinstall.html)
- [OpenClaw npm error code EBADENGINE on unsupported Node](https://cwyn.com/pages/openclaw-guide-unsupported-node-version.html)

## Next steps

- [All 135 OpenClaw guides](https://cwyn.com/guides/openclaw/)
- [OpenClaw setup walkthrough](https://cwyn.com/setup/openclaw/)
- [CWYN Score](https://cwyn.com/pages/score.html)
- [OpenClaw Complete Setup Pack ($14.95)](https://cwyn.com/pages/pack-openclaw-complete-setup-pack.html)

### Check the Gateway once the command works

The [OpenClaw Complete Setup Pack ($14.95)](https://cwyn.com/pages/pack-openclaw-complete-setup-pack.html) is an optional paid kit with a Gateway and Telegram pairing checklist you can use once the CLI opens in a fresh terminal.
Kit details as of Nov 18, 2026

OpenClaw Complete Setup Pack $14.95

Start an OpenClaw workspace with editable instructions, local Gateway and tool presets, and checklists for pairing, memory, costs and rollback.
