AI Workshop: learn to build apps with AI →
Setup and Installation: How to fix the Homebrew error `Permission denied @ apply2files`

Join the AI Workshop and learn to build real-world apps with AI. A hands-on, practical program to level up your skills.


After running brew upgrade node to upgrade my Node.js installation on macOS, Homebrew decided to run brew cleanup automatically.

It was doing its thing, with a bunch of Removing: /Users/..... messages until I got the error

Error: Permission denied @ apply2files - /usr/local/lib/docker/cli-plugins

🤔

See “docker” in the path?

Turns out I had deleted Docker recently and this was causing an error. To fix it, I recreated a folder that the Docker app had used:

mkdir -p /Applications/Docker.app/Contents/Resources/cli-plugins

Then run:

brew cleanup

again. That should fix the issue.

Your issue might be caused by another missing library, not Docker. In that case, search for the specific error message to see if others have run into it and found a solution.

Lessons in this unit:

0: Introduction
1: ▶︎ How to fix the Homebrew error `Permission denied @ apply2files`
2: How to update Node.js
3: How to install Node.js
4: The Node.js Runtime v8 options list
5: Ubuntu how to upgrade Node.js