permissionsdirectoryhomebrewmkdir

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


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.


Solution

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

    Uninstall Homebrew:

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
    

    Re-install Homebrew:

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    

    Performed in MacOS Mojave (10.14.4)