npm / pnpm
Manual global install via npm or pnpm for users who already have Node 22+ and prefer managing the install themselves.
Tags: npm, pnpm, manual, node
Use Cases
- Developers who already manage their own Node.js environment and want a clean, controlled install
- Teams that need to pin OpenClaw to a specific version across multiple machines
- CI/CD environments where the installer script's interactive prompts aren't appropriate
- Users running Node version managers (nvm, fnm) who want OpenClaw scoped to a specific Node version
Tips
- Use a Node version manager (nvm, fnm, volta) to avoid permission issues with global npm installs
- Pin to a specific version in CI: npm install -g openclaw@2026.3.20 instead of @latest
- Install from GitHub main branch for bleeding-edge features: npm install -g github:openclaw/openclaw#main
- After updating, always restart the gateway: openclaw gateway restart
- Run openclaw doctor after install to verify all dependencies are correctly set up
- For pnpm users, run pnpm approve-builds -g immediately after install to avoid missing native modules
Known Issues & Gotchas
- pnpm requires an explicit pnpm approve-builds -g step after install — without it, native modules like sharp won't compile and image features break silently
- If you have a globally installed libvips, sharp may fail to build — fix with SHARP_IGNORE_GLOBAL_LIBVIPS=1 npm install -g openclaw@latest
- The global npm bin directory must be in your PATH — run echo $PATH and check it includes $(npm prefix -g)/bin
- No auto-updates: you must manually run npm install -g openclaw@latest to get new versions
- On some systems, npm global installs require sudo — use a Node version manager (nvm, fnm) instead to avoid permission issues
- Node 20 and below are not supported — check with node -v before installing
Alternatives
- Installer Script
- From Source
- Docker
Community Feedback
If you already have node set up, npm install -g is the cleanest path. No mystery scripts, just a package install you control.
— Reddit r/selfhosted
The sharp build error caught me off guard. Had to set SHARP_IGNORE_GLOBAL_LIBVIPS=1 before npm install would work.
— Reddit r/selfhosted
pnpm users: don't forget pnpm approve-builds -g after install. Spent 20 minutes debugging why features were missing.
— Reddit r/AI_Agents
Frequently Asked Questions
Should I use npm or pnpm to install OpenClaw?
Both work equally well. npm is simpler (one command), while pnpm is faster and more disk-efficient but requires the extra pnpm approve-builds -g step. If you already use pnpm in your workflow, stick with it.
How do I update OpenClaw installed via npm?
Run npm install -g openclaw@latest, then openclaw gateway restart. There's no built-in auto-update mechanism with the npm method — you control when updates happen.
Why does the install fail with a sharp error?
The sharp image processing library can conflict with a globally installed libvips. Fix it by running SHARP_IGNORE_GLOBAL_LIBVIPS=1 npm install -g openclaw@latest. This tells sharp to use its own bundled binaries.
Can I install OpenClaw locally instead of globally?
OpenClaw is designed as a CLI and daemon, so global install is recommended. However, if building from source, you can use pnpm openclaw from inside the repo without linking globally.
Do I need sudo for npm install -g?
If you installed Node via a version manager (nvm, fnm, volta), no sudo is needed. If Node was installed system-wide (e.g., via apt), you may need sudo. Using a version manager is the recommended approach.
What's the minimum Node version required?
Node 22.16+ or Node 24+. Node 24 is recommended for best performance. Check your version with node -v before installing.