Quick Navigation

Fix “openclaw: command not found” (Linux, WSL2, Raspberry Pi)

Environment Setup

Last Updated: April 15, 2026 | Author: DevOps Engineering Team | Platforms: Linux / Raspberry Pi / Debian / Ubuntu / WSL2

Quick Answer: Fix openclaw: command not found

This is one of the most common post-installation issues, especially on Linux environments. However, it can also be caused by incomplete installation, Node.js incompatibility, or a misconfigured npm prefix. Depending on how Node.js and npm were installed, the global bin directory may not be included in your PATH.

  • Check if OpenClaw is installed: npm list -g openclaw
  • Check global bin path: echo $(npm prefix -g)/bin
  • Add to PATH temporarily: export PATH=$(npm prefix -g)/bin:$PATH
  • Restart your terminal to apply permanent changes

In most cases, the issue is caused by a missing PATH configuration rather than a failed installation.

Common Root Causes

  • npm global binary directory not included in system PATH
  • Shell environment not reloaded after installation
  • Incomplete or silent OpenClaw installation failure
  • Incompatible Node.js version (requires 24.x / 22.14+)
  • Misconfigured custom npm prefix path

1-Click Diagnostic Command

command -v openclaw || echo "Not found"
echo $PATH
echo $(npm prefix -g)/bin
npm list -g openclaw

🧠 openclaw: command not found Fix Map

  • Root Cause
    • Missing PATH configuration for npm binaries
    • Unreloaded shell environment
    • Incomplete installation / Node mismatch
    • Misconfigured npm prefix
  • Quick Fix
    • Verify installation status
    • Update PATH temporarily
    • Restart terminal session
  • Permanent Fix
    • Add PATH to shell config file
    • Use official installer for auto-configuration
    • Validate Node.js version compatibility
  • Prevention
    • Restart shell after every installation
    • Use official script to avoid PATH issues

Quick Verification

# Verify if openclaw command is detectable
command -v openclaw || echo "OpenClaw binary not found in PATH"

# Verify OpenClaw installation status
npm list -g openclaw

What Does This Error Mean?

The error openclaw: command not found indicates your system cannot locate the OpenClaw executable file. After installing OpenClaw via npm install -g or the official script, the binary is stored in npm’s global bin directory. Depending on how Node.js and npm were installed, the global bin directory may not be included in your PATH.

This is a standard Linux environment configuration issue, not an OpenClaw application bug.

Typical Error Output

openclaw: command not found
bash: openclaw: command not found

Environment Compatibility Reference

Platform Common Cause Fastest Fix
Linux / Raspberry Pi npm bin directory missing from PATH Add PATH to ~/.bashrc
WSL2 Shell not restarted post-installation Restart terminal
Custom npm prefix Incorrect binary installation path Reconfigure npm prefix

Step-by-Step Fixes

1. Restart Your Shell (Simplest Fix)

# Reload shell configuration immediately
source ~/.bashrc
# For Zsh users
source ~/.zshrc

2. Locate OpenClaw Binary (Professional Method)

# Check if command exists
command -v openclaw
which openclaw

3. Add npm Global Bin to PATH (Permanent Solution)

# Get official npm global binary path
npm prefix -g

# Add PATH to bash config (permanent)
echo 'export PATH=$(npm prefix -g)/bin:$PATH' >> ~/.bashrc
source ~/.bashrc

4. Reinstall Using Official Script (Most Reliable)

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

The official installer automatically configures PATH, permissions, and Node.js version.

5. Validate OpenClaw Installation

openclaw --version
openclaw doctor

Not This Error?

  • npm install failed → OpenClaw installation issue
  • permission denied → npm EACCES permission configuration issue
  • openclaw crashes after launch → OpenClaw runtime compatibility issue

FAQ (AI & Google Optimized)

Q: Why is openclaw not found after installation?

A: This happens because your system cannot find the OpenClaw binary in PATH. It may also relate to incomplete installation, Node version mismatch, or misconfigured npm prefix.

Q: How do I fix command not found permanently?

A: Add npm’s global bin directory to your shell configuration file, or use the official OpenClaw installer for automatic environment setup.

Q: openclaw not recognized or not working?

A: This is the same issue as command not found. Follow the PATH configuration steps to resolve unrecognized/missing command errors.

Q: Does this affect Raspberry Pi / WSL2?

A: Yes. This is the top post-installation environment issue on ARM devices and WSL2 Linux systems.

Q: Is this an OpenClaw software bug?

A: No. This is a standard Linux environment configuration issue related to npm global tool installation.


Official Best Practices

  • ✅ Always restart your terminal after OpenClaw installation
  • ✅ Use the official installer to avoid PATH and permission issues
  • ✅ Verify Node.js version (24.x recommended, 22.14+ compatible)
  • ✅ Use command -v openclaw to quickly validate command availability

Official References


Related High-Performance Guides

滚动至顶部