Last verified: 2026-06-11

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

Still stuck?

See the full cross-platform troubleshooting index, the OpenClaw hub, or the command reference. Paste your error into the search box on the index to find related fixes.