Vibe Coding Academy Logo Vibe Coding Academy

Fix OpenClaw Install Failed on Mac

Getting "npm install failed" with no error message? The installer hides the real problem. Here's the fix.

Published February 27, 2026 · 3 min read

#OpenClaw #Troubleshooting #Mac

🚀 TL;DR — The Fix

The OpenClaw installer fails silently on Mac due to npm permissions. Run this instead:

sudo npm install -g openclaw@latest

Then run openclaw onboard (without sudo) to complete setup.

The Problem

You're trying to install OpenClaw on your Mac using the recommended installer:

curl -fsSL https://openclaw.ai/install.sh | bash

But it fails with a cryptic message:

! npm install failed for openclaw@latest
! npm install failed; showing last log lines
! npm install failed; retrying
! npm install failed for openclaw@latest

When you check the log file, it's empty. No error. Nothing.

❌ Why the logs are empty

The installer script runs npm with --silent mode, which suppresses error output. The actual error is being swallowed.

Finding the Real Error

To see what's actually failing, run npm install directly (without the installer script):

npm install -g openclaw@latest

Now you'll see the actual error:

npm error code EACCES
npm error syscall mkdir
npm error path /usr/local/lib/node_modules/openclaw
npm error errno -13
npm error Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/openclaw'

There it is: EACCES: permission denied. npm can't create the directory because your user doesn't have write access to /usr/local/lib/node_modules/.

The Fix

Run the npm install with sudo to give it the elevated permissions it needs:

sudo npm install -g openclaw@latest

Enter your password when prompted. You'll see the installation complete successfully.

✅ Installation Complete

Once npm finishes, OpenClaw is installed. Now run the onboarding (without sudo):

openclaw onboard

Why This Happens

On macOS, /usr/local/lib/node_modules/ is typically owned by root. When you install global npm packages, npm needs write access to this directory.

The OpenClaw installer script doesn't run with elevated permissions by default, so npm fails silently when it can't create the necessary directories.

💡 Alternative: Fix npm permissions permanently

If you don't want to use sudo for npm installs, you can change ownership of the npm directories:

sudo chown -R $(whoami) /usr/local/lib/node_modules

After this, regular npm installs will work without sudo. However, using sudo for the single install is faster and doesn't change system permissions.

Common Related Errors

Error: Your cache folder contains root-owned files

If you see this error:

npm error Your cache folder contains root-owned files, due to a bug in
npm error previous versions of npm which has since been addressed.
npm error   sudo chown -R 501:20 "/Users/yourusername/.npm"

Run the suggested command to fix cache permissions, then retry:

sudo chown -R $(whoami) ~/.npm
sudo npm install -g openclaw@latest

Summary

The OpenClaw installer fails on Mac because:

  1. npm needs write access to /usr/local/lib/node_modules/
  2. Your user doesn't have permission by default
  3. The installer's --silent mode hides the actual error

The fix: Use sudo npm install -g openclaw@latest instead of the installer script.

New to OpenClaw?

Check out our complete setup guide to get your AI agent running on Mac.

Full Mac Setup Guide →
Abdul Khan
Written by
Abdul Khan