npm Guide
npm install OpenClaw
This page targets npm command intent: how to run npm install -g openclaw@latest correctly, verify the install, and continue onboarding.
If you want all install methods (script + npm + pnpm + source), use install OpenClaw. If npm install succeeds but runtime fails, jump to troubleshooting.
Run npm install -g openclaw@latest, then run openclaw onboard --install-daemon to complete setup.
npm vs pnpm: which should you use?
- Use npm if you want the default Node package manager with no extra setup and the most familiar workflow.
- Use pnpm if your team already uses pnpm/workspaces or you want faster installs with stricter dependency layout.
- Simple rule: quick single-machine setup -> npm; existing pnpm-based team environment -> pnpm.
Prerequisites
- Node 22+ installed.
- npm 10+ or pnpm 9+.
- LLM provider credentials (OpenAI/Anthropic/Gemini).
Check your versions:
node -v npm -v
Install via npm
npm install -g openclaw@latest
Verify installation:
openclaw --version
Install via pnpm
pnpm add -g openclaw@latest
Approve builds if prompted:
pnpm approve-builds -g
Verify installation:
openclaw --version
Post-install: run onboarding
openclaw onboard --install-daemon
This wizard will:
- Configure your LLM provider credentials.
- Set up workspace defaults.
- Configure gateway settings.
- Optionally add Telegram or Slack channels.
Verify your installation
openclaw doctor openclaw status openclaw gateway status
Open the dashboard:
openclaw dashboard
This opens the Control UI at http://127.0.0.1:18789/.
Common errors and quick fixes
"openclaw: command not found"
This is almost always a PATH issue. Check where npm installs global binaries:
npm prefix -g
Add this to your shell profile (~/.bashrc, ~/.zshrc, or PowerShell profile):
export PATH="$(npm prefix -g)/bin:$PATH"
Then reload your shell:
source ~/.bashrc # or source ~/.zshrc
Permission denied (EACCES)
Avoid using sudo npm install -g. Instead, fix your npm prefix:
mkdir -p ~/.npm-global npm config set prefix '~/.npm-global' export PATH="$HOME/.npm-global/bin:$PATH"
Node version too old
Update Node.js:
nvm install 22 nvm use 22
Or download from nodejs.org.
Module not found after install
Clear npm cache and reinstall:
npm cache clean --force npm install -g openclaw@latest