Quick Navigation

Fix “node: command not found” (Mac, Linux, WSL) – Complete Guide

Environment Setup

Last Updated: April 20, 2026 | Author: DevOps Engineering Team | Platforms: Linux / Raspberry Pi / macOS / WSL2

This error is not a system failure. It simply means Node.js is missing or misconfigured — and can be fixed in minutes.

Quick Answer: Fix node: command not found

The error node: command not found indicates Node.js is not installed or not available in your system PATH. As stated in OpenClaw’s official Install Guide, OpenClaw requires Node.js 24 (recommended) or Node 22.16+ LTS for compatibility.

  • Use the official OpenClaw installer (it automatically installs Node 24 if missing)
  • Install Node.js manually using a version manager (NVM recommended)
  • Verify Node.js installation after setup
  • Restart your terminal to apply PATH changes

The official OpenClaw installer script is the simplest solution — it handles Node.js detection and installation automatically.

If you prefer manual installation, use a Node version manager like NVM to avoid permission issues and easily switch between versions. This approach is recommended in the official OpenClaw getting started guide.

Quick Fix (Fastest Solution)

  1. Install Node using the official OpenClaw installer
  2. Or install Node.js via NVM (industry standard)
  3. Restart your terminal session
  4. Verify installation with node -v

1-Click Diagnostic Command

# Check if Node.js is installed
command -v node || echo "Node.js not found"
which node || echo "Node.js not in PATH"

# Check for Node version managers
command -v nvm || echo "NVM not found"
command -v brew || echo "Homebrew not found"

🧠 node: command not found Fix Map

  • Root Cause
    • Node.js not installed
    • Node not in PATH
    • Shell not reloaded
    • Version manager conflict
    • Corrupted installation
  • Quick Fix
    • Use official OpenClaw installer
    • Install Node.js via NVM
    • Restart terminal
  • Permanent Fix
    • Set up NVM for version management
    • Add Node to shell config
    • Use official installer
  • Prevention
    • Use version managers
    • Restart shell after installs
    • Use official OpenClaw installer

Quick Diagnosis Flow

  • If you want the simplest solution → use official OpenClaw installer
  • If you want to manage Node versions yourself → install NVM
  • If Node was installed but not found → check PATH and restart shell
  • If you’re on macOS → use Homebrew or NVM

Real-World Causes

  • Installed Node but forgot to reload shell
  • NVM installed but not sourced in .zshrc
  • Installed via brew but PATH not linked
  • Using sudo npm → broke permissions
  • WSL installed Node in Windows instead of Linux
  • Multiple Node.js versions conflicting
  • Node.js installation corrupted or incomplete

What Does This Error Mean?

The error node: command not found means your shell cannot locate the Node.js executable in any directory listed in your system PATH.

OpenClaw has specific Node.js requirements:

  • Recommended: Node.js 24.x
  • Supported: Node.js 22.16+ LTS (for compatibility)

The official OpenClaw installer script will automatically install Node.js 24 if it’s missing from your system.

Typical Error Output

node: command not found
bash: node: command not found
zsh: command not found: node

Fix by Platform (Mac / Linux / WSL)

Fix on macOS

On macOS, the recommended methods are the official OpenClaw installer or Homebrew:

# Method 1: Official OpenClaw installer (recommended)
curl -fsSL --proto '=https' --tlsv1.2 https://openclaw.ai/install.sh | bash

# Method 2: Homebrew
brew install node@24
brew link node@24 --overwrite --force

# Verify installation
node -v
npm -v

Fix on Linux / Raspberry Pi

On Linux and Raspberry Pi, use the official installer or NVM:

# Method 1: Official OpenClaw installer (recommended)
curl -fsSL --proto '=https' --tlsv1.2 https://openclaw.ai/install.sh | bash

# Method 2: NVM (Node Version Manager)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
source ~/.bashrc
nvm install 24
nvm use 24
nvm alias default 24

# Verify installation
node -v
npm -v

Fix on WSL2

On WSL2, always install Node.js inside the Linux environment, not Windows:

# Method 1: Official OpenClaw installer (recommended)
curl -fsSL --proto '=https' --tlsv1.2 https://openclaw.ai/install.sh | bash

# Method 2: NVM
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
source ~/.bashrc
nvm install 24
nvm use 24
nvm alias default 24

# Verify installation
node -v
npm -v

Step-by-Step Fixes

1. Use Official OpenClaw Installer (TOP RECOMMENDED)

This is the simplest and most reliable method. The official installer automatically detects, installs, and configures Node.js 24 if it’s missing:

curl -fsSL --proto '=https' --tlsv1.2 https://openclaw.ai/install.sh | bash

To skip onboarding and just install Node.js and OpenClaw:

curl -fsSL --proto '=https' --tlsv1.2 https://openclaw.ai/install.sh | bash -s -- --no-onboard

This is the official recommended installation method in the OpenClaw documentation.

2. Install Node.js via NVM (Node Version Manager)

If you prefer to manage Node.js versions yourself, NVM is the recommended approach:

NVM is the industry-standard way to install Node.js without permission issues.

# Install NVM
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash

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

# Install Node.js 24 (recommended)
nvm install 24
nvm use 24
nvm alias default 24

# Verify installation
node -v
npm -v

3. Install Node.js via Homebrew (macOS)

On macOS, you can use Homebrew to install Node.js:

# Install Homebrew if not already installed
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# Install Node.js 24
brew install node@24

# Link Node.js 24
brew link node@24 --overwrite --force

# Add to PATH (if needed)
echo 'export PATH="/opt/homebrew/opt/node@24/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc

# Verify installation
node -v
npm -v

4. Install Node.js via Linux Package Manager

On Linux, you can use your distribution’s package manager:

# Ubuntu/Debian
curl -fsSL https://deb.nodesource.com/setup_24.x | sudo -E bash -
sudo apt-get install -y nodejs

# Fedora/RHEL
curl -fsSL https://rpm.nodesource.com/setup_24.x | sudo bash -
sudo dnf install -y nodejs

# Verify installation
node -v
npm -v

5. Node Installed but Still Not Found?

If you’ve installed Node.js but still get the error, it’s almost always one of these issues:

  • Shell not reloaded after installation
  • Wrong PATH order (old Node version comes first)
  • Installed under a different user account
  • NVM not initialized in your shell config
  • Corrupted Node.js installation
# Reload shell configuration
source ~/.bashrc
# For Zsh users
source ~/.zshrc

# Check PATH order
echo $PATH

# Verify NVM is initialized
command -v nvm

# Reinstall Node.js if needed
nvm uninstall 24
nvm install 24

6. Restart Your Terminal

After installing Node.js, always restart your terminal or reload your shell configuration:

# Reload shell configuration (no restart needed)
source ~/.bashrc

# For Zsh users
source ~/.zshrc

# For Fish users
source ~/.config/fish/config.fish

# Or simply close and reopen your terminal

Common Search Variations

  • node: command not found
  • nodejs command not found
  • node not found after install
  • bash: node: command not found
  • zsh: command not found: node
  • node command not found mac
  • node command not found linux
  • node command not found wsl2
  • node installed but not found
  • node not in path

FAQ (AI & Google Optimized)

Q: What does “node: command not found” mean?

A: It means your shell cannot find the Node.js executable in your system PATH. Node.js is either not installed or not properly configured.

Q: How do I fix “node: command not found”?

A: The simplest solution is to use the official OpenClaw installer script, which automatically installs Node.js 24 if missing. Alternatively, install Node.js manually using NVM.

Q: What Node.js versions are supported by OpenClaw?

A: OpenClaw recommends Node.js 24.x. Node.js 22.16+ LTS is still supported for compatibility. Older versions are not supported.

Q: Do I need to install Node.js before OpenClaw?

A: No. The official OpenClaw installer script will automatically detect and install Node.js 24 if it’s missing from your system.

Q: Can I use multiple Node.js versions?

A: Yes. Use a Node version manager like NVM to easily switch between different Node.js versions.

Q: Why is node not found after installation?

A: Usually because the shell has not been reloaded or Node is not added to PATH.

Q: node works in one terminal but not another?

A: This indicates a shell configuration issue (PATH or NVM not loaded).


Summary

node: command not found indicates Node.js is not installed or not available in your system PATH. The simplest and most reliable solution is to use the official OpenClaw installer script, which automatically handles Node.js detection and installation. If you prefer manual installation, use a Node version manager like NVM.


Official Best Practices

  • ✅ Use the official OpenClaw installer for automatic Node.js setup
  • ✅ Use Node.js 24.x for the best compatibility
  • ✅ Use a Node version manager (NVM) to avoid version conflicts
  • ✅ Always restart your terminal after installing Node.js
  • ✅ Verify Node.js installation with node -v before installing OpenClaw
  • ✅ On Windows, use WSL2 for the best OpenClaw experience

Official References


Related High-Performance Guides

Scroll to Top