openclaw/docs/install/node.md
chenglun.hu 603f350879
docs: clarify moltbot/clawdbot CLI naming fallback
Fixes #3038

Users hit "command not found: moltbot" after install because docs only
reference `moltbot`, but package.json defines both `moltbot` and `clawdbot`
bins. Some install methods may expose only `clawdbot`.

Changes:
- Add "try clawdbot (compatibility shim)" fallback in 7 key docs
- README, install docs, getting started, troubleshooting
- Consistent messaging: try clawdbot first → then check PATH
- All links follow Mintlify root-relative convention

Reviewed-by: Codex (threadId: 019c0332-8694-7531-b987-a6f795e1a668)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-28 14:08:50 +08:00

2.3 KiB
Raw Blame History

title summary read_when
Node.js + npm (PATH sanity) Node.js + npm install sanity: versions, PATH, and global installs
You installed Moltbot but `moltbot` is “command not found”
Youre setting up Node.js/npm on a new machine
npm install -g ... fails with permissions or PATH issues

Node.js + npm (PATH sanity)

Moltbots runtime baseline is Node 22+.

If you can run npm install -g moltbot@latest but later see moltbot: command not found, first try clawdbot (compatibility shim). If that also fails, it's almost always a PATH issue: the directory where npm puts global binaries isn't on your shell's PATH.

Quick diagnosis

Run:

node -v
npm -v
npm prefix -g
echo "$PATH"

If $(npm prefix -g)/bin (macOS/Linux) or $(npm prefix -g) (Windows) is not present inside echo "$PATH", your shell cant find global npm binaries (including moltbot).

Fix: put npms global bin dir on PATH

  1. Find your global npm prefix:
npm prefix -g
  1. Add the global npm bin directory to your shell startup file:
  • zsh: ~/.zshrc
  • bash: ~/.bashrc

Example (replace the path with your npm prefix -g output):

# macOS / Linux
export PATH="/path/from/npm/prefix/bin:$PATH"

Then open a new terminal (or run rehash in zsh / hash -r in bash).

On Windows, add the output of npm prefix -g to your PATH.

Fix: avoid sudo npm install -g / permission errors (Linux)

If npm install -g ... fails with EACCES, switch npms global prefix to a user-writable directory:

mkdir -p "$HOME/.npm-global"
npm config set prefix "$HOME/.npm-global"
export PATH="$HOME/.npm-global/bin:$PATH"

Persist the export PATH=... line in your shell startup file.

Youll have the fewest surprises if Node/npm are installed in a way that:

  • keeps Node updated (22+)
  • makes the global npm bin dir stable and on PATH in new shells

Common choices:

  • macOS: Homebrew (brew install node) or a version manager
  • Linux: your preferred version manager, or a distro-supported install that provides Node 22+
  • Windows: official Node installer, winget, or a Windows Node version manager

If you use a version manager (nvm/fnm/asdf/etc), ensure its initialized in the shell you use day-to-day (zsh vs bash) so the PATH it sets is present when you run installers.