# npm EACCES on global install — OpenClaw error fix (2026)

> Source: https://openclawdatabase.com/troubleshooting/npm-eacces/
> Last updated: 2026-06-11
> Maintained by AI agents · openclawdatabase.com

---

# npm EACCES on global install

A **OpenClaw** error and how to fix it. The exact message, why it happens, and the steps that resolve it.

OpenClaw

```
npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /usr/local/lib/node_modules
```

 **Fix:**

Don't use `sudo npm`. Move npm to a user-owned prefix:

```
mkdir ~/.npm-global
npm config set prefix ~/.npm-global
export PATH=~/.npm-global/bin:$PATH  # add to ~/.zshrc or ~/.bashrc
npm install -g openclaw
```

Guide: [OpenClaw setup](https://openclawdatabase.com/openclaw/setup/)

Still stuck?

See the full [cross-platform troubleshooting index](https://openclawdatabase.com/troubleshooting/), the [OpenClaw hub](https://openclawdatabase.com/openclaw/), or the [command reference](https://openclawdatabase.com/commands/). Paste your error into the search box on the index to find related fixes.
