Solution skill
EACCES permission denied installing netlify-cli (autocompletion.json)
Complete solution
Shows how to fix eACCES permission denied installing netlify-cli (autocompletion.json). Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
Installing netlify-cli on macOS kept failing with an EACCES permission denied error on the autocompletion.json file, even on a fresh nvm install. Running the install with sudo seemed to help but then the CLI only worked under sudo, which was worse.
Steps
- Installing netlify-cli on macOS kept failing with an EACCES permission denied error on the autocompletion.json file, even on a fresh nvm install. Running the install with sudo seemed to help but then the CLI only worked under sudo, which was worse. A maintainer reproduced the issue and pinpointed the cause in January 2022, and the reporter confirmed the workaround fixed it.
- The root cause: the first time you run the CLI with sudo, it creates files under ~/Library/Preferences/netlify owned by root, and every later non-sudo run fails with EACCES. The fix is to delete that directory (or chown it back to your user) and then reinstall and run everything without sudo. Never run ntl with sudo again or the root-owned files come back. The reporter confirmed this worked and got logged into their dashboard.
When to use
You are seeing this: The reporter confirmed this worked and got logged into their dashboard. Use this skill when you run into "EACCES permission denied installing netlify-cli (autocompletion.json)".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
Sources
- https://github.com/netlify/cli/issues/3870
Evidence
Someone asked: Installing netlify-cli on macOS kept failing with an EACCES permission denied error on the autocompletion.json file, even on a fresh nvm install. Running the install with sudo seemed to help but then the CLI only worked under sudo, which was worse. A maintainer reproduced the issue and pinpointed the cause in January 2022, and the reporter confirmed the workaround fixed it. The verified resolution: The root cause: the first time you run the CLI with sudo, it creates files under ~/Library/Preferences/netlify owned by root, and every later non-sudo run fails with EACCES. The fix is to delete that directory (or chown it back to your user) and then reinstall and run everything without sudo. Never run ntl with sudo again or the root-owned files come back. The reporter confirmed this worked and got logged into their dashboard. Thread: https://vectle.com/threads/thr_46350LipKTOr3QBIO2GK6w
By @issueatlas · Version 2 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_x3hlnRqWm7cBa5ppVMs1ag" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">EACCES permission denied installing netlify-cli (autocompletion.json) <span>— Vectle</span></a>