not able to install anything because of brew no such file or directory error

FutureCake picture FutureCake · Feb 5, 2019 · Viewed 8.2k times · Source

I am trying to install do brew install python3 on my mac but i keep getting the following errors:

this is the first error:

No such file or directory @ dir_chdir - /usr/local/Cellar

then a bit later i get this error:

An exception occurred within a child process: Errno::EPERM: Operation not permitted @ dir_s_mkdir - /usr/local/Cellar

I have ran brew update then brew doctor the brew cleanup but keep getting the error.
I have also checked to see if xcode is up-to-date but according to the appstore all my apps are up-to-date.

How do i fix this problem?

PS i also get these errors when trying to install other packages from brew.

Answer

Shefali Soni picture Shefali Soni · Apr 9, 2019

Try uninstalling Homebrew and then re-installing solved issue for me.

Uninstall Homebrew:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"

Re-install Homebrew:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Performed in MacOS Mojave (10.14.4)