npm / pnpm

Manual global install via npm or pnpm for users who already have Node 22+ and prefer managing the install themselves.

The npm/pnpm install method is for developers who already have a working Node.js environment and prefer explicit control over how packages are installed. Rather than running a curl script that may install Node for you, this method assumes you've already got Node 22.16+ (or Node 24) set up via your preferred version manager (nvm, fnm, volta, Homebrew, etc.). Installation is a single command: `npm install -g openclaw@latest` for npm users, or `pnpm add -g openclaw@latest` followed by `pnpm approve-builds -g` for pnpm users. The approve-builds step is specific to pnpm, which requires explicit approval for packages with build scripts (like sharp, the image processing library OpenClaw uses). After installing, run `openclaw onboard --install-daemon` to configure your provider, channels, and system service. This method does not include auto-updates — you're responsible for running `npm install -g openclaw@latest` when new versions are released. This is actually a feature for developers who want to pin specific versions or test before upgrading. You can also install from a specific branch or commit: `npm install -g github:openclaw/openclaw#main` to run bleeding-edge code. The npm method is the standard path for anyone comfortable with the Node ecosystem. It gives you the most control while still being a two-command process. Most developers who've used any Node.js CLI tool will find this familiar and predictable.

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.