troubleshooting

OpenClaw Command Not Found (Fix)

How to fix the 'openclaw: command not found' error on Windows, macOS, and Linux. Step-by-step solutions for beginners with no technical experience required.

7 min read
Updated 2026-02-02

Common Error Quick Reference

  • command not found - Command not found → Restart terminal or reinstall
  • The term 'openclaw' is not recognized - Command not recognized (Windows) → Check PATH environment variable
  • EACCES: permission denied - Permission denied → Configure npm-global directory
  • ENOENT: no such file or directory - File or directory not found → Check if path is correct

What This Error Means

When you type openclaw and see this message:

bash

openclaw: command not found

Or on Windows:

powershell

openclaw : The term 'openclaw' is not recognized

It means your computer cannot find the OpenClaw program. Do not worry - this is one of the most common problems and is usually easy to fix.

Try This First

Close your terminal (Ubuntu, PowerShell, or Terminal app) completely and open it again. Then type openclaw --version and press Enter. If it works now, you are done! If not, keep reading.

Why Does This Happen?

Think of your computer like a big library. When you type openclaw, your computer needs to know which "shelf" to look on to find the program. The list of shelves your computer checks is called the PATH.

This error happens when:

  1. OpenClaw did not install properly - The download or installation failed
  2. Your computer does not know where to look - OpenClaw is installed, but not in a location your computer checks
  3. You need to restart - Your computer needs to refresh its list of programs

Which Computer Are You Using?

Find your situation below and follow those steps:


Fix for Windows with Ubuntu (WSL2)

If you followed our Windows installation guide and are using the Ubuntu app, follow these steps:

1

Close and reopen Ubuntu

Sometimes the fix is this simple:

  1. In the Ubuntu window, type exit and press Enter
  2. Wait a few seconds
  3. Open Ubuntu again from the Start menu
  4. Type openclaw --version and press Enter

Did it work? If yes, you are done! If not, continue to the next step.

2

Try reinstalling OpenClaw

Let us install OpenClaw again. Type this command and press Enter:

bash

curl -fsSL https://openclaw.ai/install.sh | bash

What Does This Do?

This downloads the OpenClaw installer from the internet and runs it. It is safe and will replace any broken installation.

After it finishes, close Ubuntu (type exit) and open it again. Then try:

bash

openclaw --version

Expected Result

openclaw/1.x.x

3

Tell your computer where to find OpenClaw

If reinstalling did not work, we need to tell your computer where OpenClaw is located.

Copy and paste this entire command (all three lines together) and press Enter:

bash

mkdir -p ~/.npm-global npm config set prefix ~/.npm-global echo 'export PATH="$HOME/.npm-global/bin:$PATH"' >> ~/.bashrc

What Do These Commands Do?

  • Line 1: Creates a folder called .npm-global in your home directory
  • Line 2: Tells npm (the package manager) to install programs there
  • Line 3: Tells your computer to look in that folder for programs

Now reload your settings:

bash

source ~/.bashrc

Reinstall OpenClaw:

bash

npm install -g openclaw@latest

Test if it works:

bash

openclaw --version

Expected Result

openclaw/1.x.x


Consider Using WSL2 Instead

OpenClaw works much better with WSL2/Ubuntu than with native Windows. If you have not tried WSL2 yet, we recommend following our Windows installation guide instead.

If you must use PowerShell directly:

1

Find where npm puts programs

Open PowerShell and type:

powershell

npm config get prefix

You will see something like:

Expected Result

C:\Users\YourName\AppData\Roaming\npm

Write down or copy this path - you will need it in the next step.

2

Add that location to your PATH

Now we need to tell Windows to look in that folder. This involves changing a Windows setting:

  1. Press the Windows key and R at the same time
  2. Type sysdm.cpl and press Enter
  3. A "System Properties" window will open
  4. Click the Advanced tab at the top
  5. Click the Environment Variables button near the bottom
  6. In the top section ("User variables"), find Path and click on it
  7. Click Edit
  8. Click New
  9. Paste the path you copied earlier (like C:\Users\YourName\AppData\Roaming\npm)
  10. Click OK on all windows to save
3

Restart PowerShell and test

Important: You must close ALL PowerShell windows and open a new one. The old windows will not have the updated settings.

In the new PowerShell window:

powershell

openclaw --version


Fix for macOS

1

Close and reopen Terminal

  1. Close the Terminal app completely (Command + Q)
  2. Open Terminal again
  3. Type openclaw --version and press Enter

If it works, you are done!

2

Reinstall OpenClaw

Type this command and press Enter:

bash

curl -fsSL https://openclaw.ai/install.sh | bash

Close Terminal and open it again. Then test:

bash

openclaw --version

3

Update your shell settings

If reinstalling did not work, we need to update your settings. Most modern Macs use zsh (the default shell).

Type this command and press Enter:

bash

echo 'export PATH="$HOME/.openclaw/bin:$HOME/.npm-global/bin:$PATH"' >> ~/.zshrc

Reload your settings:

bash

source ~/.zshrc

Test again:

bash

openclaw --version

Using an Older Mac?

If your Mac is from before 2019, you might be using bash instead of zsh. In that case, replace ~/.zshrc with ~/.bash_profile in the commands above.


Fix for Linux

1

Close and reopen your terminal

Close your terminal window and open a new one. Then type:

bash

openclaw --version

If it works, you are done!

2

Reinstall OpenClaw

bash

curl -fsSL https://openclaw.ai/install.sh | bash

Close and reopen your terminal, then test again.

3

Update your PATH settings

Type these commands one at a time:

bash

mkdir -p ~/.npm-global

bash

npm config set prefix ~/.npm-global

bash

echo 'export PATH="$HOME/.npm-global/bin:$PATH"' >> ~/.bashrc

bash

source ~/.bashrc

Reinstall OpenClaw:

bash

npm install -g openclaw@latest

Test:

bash

openclaw --version


Still Not Working?

If none of the above solutions worked, try this complete reset:

1

Remove any existing OpenClaw installation

bash

npm uninstall -g openclaw

This removes OpenClaw completely.

2

Clear the npm cache

bash

npm cache clean --force

This clears any corrupted download files.

3

Install OpenClaw fresh

bash

npm install -g openclaw@latest

4

Restart your terminal and test

Close your terminal completely and open a new one. Then:

bash

openclaw --version

How to Prevent This Problem in the Future

Remember These Tips

Following these practices will help you avoid this problem next time.

  1. Always restart your terminal after installing programs - Many programs require a terminal restart before they can be found

  2. Use the same terminal consistently - If you install something in Ubuntu, use Ubuntu to run it. If you install in PowerShell, use PowerShell.

  3. Keep your installation notes - Write down what commands you ran during installation so you can repeat them if needed

What To Do Next

Once openclaw --version shows a version number, your installation is working! You can now:

  1. Run the setup wizard - Configure OpenClaw for first use
  2. Connect to Telegram - Set up your first chat channel
  3. Connect to WhatsApp - Use OpenClaw with WhatsApp

Still Having Trouble?

If you have tried everything and it still does not work, check the official OpenClaw documentation or contact us for help.

Last updated: February 2, 2026 | Found an error? Contact us

Related Articles