Preloader
MacOS
  • Estimated reading time: 1 Minute

How to remove the message in the terminal of MacOS BigSur: compinit:503: no such file or directory _brew_cask

How to remove the message in the terminal of MacOS BigSur: compinit:503: no such file or directory _brew_cask

This error is caused because Homebrew of the Macbook M1 is installed under the /opt/homebrew directory, however, zsh assumes that it's under the /usr/local directory. To solve this problem you may simply remove the symlinks manually using rm -rf <path-to-symlink> or better yet, run a brew cleanup with the following command:

arch -x86_64 brew cleanup

Or if you have the issue but you aren't using an ARM processor, then use:

brew cleanup

After running the command, you will get an output similar to:

Pruned 1 symbolic links from /usr/local

So, when you launch a new instance of the terminal, the error won't appear anymore!

Happy coding ❤️!

Share:
Carlos Delgado

Carlos Delgado

Senior Software Engineer at Corvix. Interested in programming since he was 14 years old, Carlos is a self-taught programmer and founder and author of most of the articles at Our Code World.

Related articles
Weekly trending
How Technology Is Making China Supplier Management More Efficient
14 Sep, 2026
  • Estimated reading time: 6 Minutes
DeFAI Development: How to Build AI-Powered DeFi Solutions
14 Sep, 2026
  • Estimated reading time: 6 Minutes
AI Can Build the Software. But Who Controls It Afterwards?
14 Sep, 2026
  • Estimated reading time: 3 Minutes
Our Sponsors

Our blog is proudly supported by industry-leading sponsors.