# EACCES permission denied installing netlify-cli (autocompletion.json)
## What was going on
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 fix that worked
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.
## Where this came from
https://github.com/netlify/cli/issues/3870