#npm warnings not allowing me to install through terminal
1 messages · Page 1 of 1 (latest)
That warning is just the installer telling you “the npm global install step failed” — the real reason is a few lines above it (or in the npm debug log). On macOS the common causes are:
- Node too old (OpenClaw needs Node 22+)
- npm global prefix not writable / permission issues
- PATH weirdness (brew Node vs nvm/fnm Node)
- network/proxy/cert issues (less common)
1) Quick info to paste here
Run these and paste the output:
which node
node -v
which npm
npm -v
npm prefix -g
2) Re-run the installer in verbose mode (so we can see the real error)
curl -fsSL https://openclaw.ai/install.sh | bash -s -- --verbose --no-onboard
Then paste the chunk around the failure (and if it prints an npm log path like ~/.npm/_logs/...debug-0.log, paste the last ~50 lines of that log too).
3) Fast workaround (avoids global npm entirely)
If this is a permissions/prefix issue, the easiest “just make it work” path is the local-prefix installer:
curl -fsSL https://openclaw.ai/install-cli.sh | bash
Docs for the installer + flags: https://docs.openclaw.ai/install/installer
Node requirement / PATH troubleshooting: https://docs.openclaw.ai/install/node
Paste the outputs from (1) + the verbose failure from (2) and we can pinpoint it quickly.
Output 1:
/usr/local/bin/node v24.13.1 /usr/local/bin/npm 11.8.0 /usr/local avivassistant@Avivs-Mac-mini ~ %
Output 2 (Only the lines that actually said 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'
npm error at async mkdir (node:internal/fs/promises:856:10)
npm error at async /usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:572:20
npm error at async Promise.allSettled (index 0)
npm error at async #reifyPackages (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:309:11)
npm error at async Arborist.reify (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:121:5)
npm error at async Install.exec (/usr/local/lib/node_modules/npm/lib/commands/install.js:150:5)
npm error at async Npm.exec (/usr/local/lib/node_modules/npm/lib/npm.js:208:9)
npm error at async module.exports (/usr/local/lib/node_modules/npm/lib/cli/entry.js:67:5) {
npm error errno: -13,
npm error code: 'EACCES',
npm error syscall: 'mkdir',
npm error path: '/usr/local/lib/node_modules/openclaw'
npm error }
npm error
npm error The operation was rejected by your operating system.
npm error It is likely you do not have the permissions to access this file as the current user
npm error
npm error If you believe this might be a permissions issue, please double-check the
npm error permissions of the file and its containing directories, or try running
npm error the command again as root/Administrator.
npm error A complete log of this run can be found in: /Users/avivassistant/.npm/_logs/2026-02-17T14_02_46_599Z-debug-0.log
That’s a straight-up permissions issue: your npm prefix -g is /usr/local, so the installer is trying to write to:
/usr/local/lib/node_modules/openclaw → and macOS blocks that for non-root users (EACCES).
You’ve got 3 options:
Option A (recommended): local-prefix install (no sudo, no global npm)
curl -fsSL https://openclaw.ai/install-cli.sh | bash
This installs under ~/.openclaw and avoids /usr/local entirely.
Option B: keep global installs, but move npm’s global prefix to your home dir
mkdir -p "$HOME/.npm-global"
npm config set prefix "$HOME/.npm-global"
# add this to ~/.zshrc (or ~/.bashrc if you use bash)
echo 'export PATH="$HOME/.npm-global/bin:$PATH"' >> ~/.zshrc
# reload shell config
source ~/.zshrc
Then rerun:
curl -fsSL https://openclaw.ai/install.sh | bash
Option C: sudo (works, but I don’t recommend it unless you know you want system-wide global npm)
sudo npm i -g openclaw
Docs refs:
- Installer: https://docs.openclaw.ai/install/installer
- Node/npm PATH & prefix: https://docs.openclaw.ai/install/node
After whichever path you pick, sanity check with:
openclaw --version
which openclaw
If Option A/B works, please mark the solution (right-click message → Apps → ✅ Mark Solution) so Answer Overflow indexes it.
what is global npm and why should I not have it
“Global npm” usually refers to installing Node packages globally with npm -g (so the command is available anywhere), as opposed to installing them inside a specific project folder.
What “global” means in practice
npm install -g openclawputs theopenclawexecutable into your npm global prefix (fromnpm prefix -g)- On your Mac, that prefix is
/usr/local, so npm tries to write into/usr/local/lib/node_modules/...
Why people say “avoid global installs” (on macOS)
It’s not that global installs are inherently bad — it’s that they often end up in system-ish directories like /usr/local, which leads to:
- Permission errors (what you hit) unless you use
sudo - Risky sudo installs:
sudo npm install -g ...runs install scripts as root, which is a security footgun and can mess up ownership/permissions later - Harder to keep clean: global tools can conflict, get stale, or differ between shells/users
The good version of “global”
If you want global CLIs, it’s totally fine — just make the global prefix user-writable, e.g. ~/.npm-global, or use a version manager (nvm/fnm) that keeps globals inside your home directory.
Why I suggested the “local-prefix” installer
install-cli.sh installs under ~/.openclaw so:
- no sudo
- no
/usr/localpermission issues - less chance of breaking other things on your system
If you tell me which option you prefer (local-prefix vs “global but in home dir”), I can give you the exact minimal commands for that path.
When I ran option A, I got the same permissions 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'
npm error at async mkdir (node:internal/fs/promises:856:10)
npm error at async /usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:572:20
npm error at async Promise.allSettled (index 0)
npm error at async #reifyPackages (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:309:11)
npm error at async Arborist.reify (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:121:5)
npm error at async Install.exec (/usr/local/lib/node_modules/npm/lib/commands/install.js:150:5)
npm error at async Npm.exec (/usr/local/lib/node_modules/npm/lib/npm.js:208:9)
npm error at async module.exports (/usr/local/lib/node_modules/npm/lib/cli/entry.js:67:5) {
npm error errno: -13,
npm error code: 'EACCES',
npm error syscall: 'mkdir',
npm error path: '/usr/local/lib/node_modules/openclaw'
npm error }
npm error
npm error The operation was rejected by your operating system.
npm error It is likely you do not have the permissions to access this file as the current user
npm error
npm error If you believe this might be a permissions issue, please double-check the
npm error permissions of the file and its containing directories, or try running
npm error the command again as root/Administrator.
npm error A complete log of this run can be found in: /Users/avivassistant/.npm/_logs/2026-02-17T14_02_46_599Z-debug-0.log
Yeah — if install-cli.sh is being used correctly, it should install into ~/.openclaw/... and you should not see /usr/local/... in the npm error.
So if you’re still seeing:
mkdir '/usr/local/lib/node_modules/openclaw'
one of these is happening:
- you accidentally ran install.sh again (not install-cli.sh), or
- you have
OPENCLAW_PREFIXset to/usr/localin your environment, so install-cli is installing there too.
Check if you have OpenClaw env vars set
Run:
env | grep -i openclaw
If you see OPENCLAW_PREFIX=/usr/local → that explains it.
“Known-good” way to run Option A (forces a home-directory prefix)
This avoids any confusion with pipes/env:
curl -fsSL https://openclaw.ai/install-cli.sh -o /tmp/openclaw-install-cli.sh
bash /tmp/openclaw-install-cli.sh --prefix "$HOME/.openclaw"
"$HOME/.openclaw/bin/openclaw" --version
If that works and you want openclaw on your PATH permanently:
echo 'export PATH="$HOME/.openclaw/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
If you paste one thing, paste this
- output of
env | grep -i openclaw
- the exact command you ran for option A (copy/paste)
…and I can tell you immediately which of the two cases it is.
"env | grep -i openclaw" came back with nothing
Good — that rules out a stray OPENCLAW_PREFIX.
If you really ran install-cli.sh, you should not be seeing /usr/local/... at all. That path strongly suggests you actually ran install.sh (or a plain npm i -g openclaw) again.
Two quick checks:
1) Paste the exact command you ran
Copy/paste it exactly (the whole line).
2) Verify which script you’re downloading
Run:
curl -fsSL https://openclaw.ai/install-cli.sh | head -n 3
It should start with something like:
# OpenClaw CLI installer (non-interactive, no onboarding)
“Force it” install (bypasses pipe confusion)
curl -fsSL https://openclaw.ai/install-cli.sh -o /tmp/openclaw-install-cli.sh
bash /tmp/openclaw-install-cli.sh --prefix "$HOME/.openclaw"
If that still errors, paste the new npm log path it prints (the timestamp/filename should change on each run).
I ran: curl -fsSL https://openclaw.ai/install-cli.sh -o /tmp/openclaw-install-cli.sh
bash /tmp/openclaw-install-cli.sh --prefix "$HOME/.openclaw"
and it came back with:
Installing OpenClaw (latest)...
changed 677 packages in 12s
OpenClaw installed (2026.2.15).
now what?
Nice — you’re installed. Next steps:
1) Make openclaw available in new terminals
Right now it’s at ~/.openclaw/bin/openclaw. Add that to your PATH:
echo 'export PATH="$HOME/.openclaw/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
Sanity check:
which openclaw
openclaw --version
2) Run onboarding + (optionally) install the daemon
This sets up auth, config, and can install the background Gateway service:
openclaw onboard --install-daemon
Then check it:
openclaw gateway status
3) Open the Control UI
openclaw dashboard
If you’re all set, please mark the solution (right-click the message that fixed it → Apps → ✅ Mark Solution) so it gets indexed for others.
when I ran: echo 'export PATH="$HOME/.openclaw/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
it came back with nothing, why?
That’s expected.
echo 'export PATH=…' >> ~/.zshrcjust appends a line to a file — it doesn’t print anything when it succeeds.source ~/.zshrcjust loads the file into your current shell — also usually prints nothing unless your.zshrcitself echoes something or errors.
To confirm it actually worked, run:
tail -n 3 ~/.zshrc
echo $PATH
which openclaw
openclaw --version
If which openclaw still shows “not found”, tell me:
echo $SHELL
and paste the output of which openclaw / any error text.
explain the daemon to me
The “daemon” is just OpenClaw’s Gateway running as a background service so it stays on even when you close your terminal.
What it does
- Runs the OpenClaw gateway server in the background
- Keeps your channels / Control UI connection available
- Starts automatically after reboot / login (depending on how it’s installed)
Why you’d want it
- You don’t have to leave a terminal window open
- More reliable for “always-on” use (Discord/Telegram/etc, scheduled crons, web UI)
What happens without it
You can still use OpenClaw, but you’d run it “foreground” style, e.g.:
openclaw gateway --port 18789
If you close that terminal, the gateway stops.