美文网首页
macos更新flutter出错

macos更新flutter出错

作者: 路过麦田 | 来源:发表于2019-05-08 15:45 被阅读0次

    之前在mac上已经安装过homebrew,并且也安装了flutter,这几天flutter更新到了1.0,想着把本地的也更新一下,结果在执行brew update时,出现了错误:

    ➜  ~ brew update
    Error: /usr/local is not writable. You should change the
    ownership and permissions of /usr/local back to your
    user account:
      sudo chown -R $(whoami) /usr/local
    

    执行sudo chown -R $(whoami) /usr/local结果又提示:

    ➜  ~ sudo chown -R $(whoami) /usr/local
    
    chown: /usr/local: Operation not permitted
    

    想用root权限试一下:

    ➜  ~ sudo brew update
    Error: Running Homebrew as root is extremely dangerous and no longer supported.
    As Homebrew does not drop privileges on installation you would be giving all
    build scripts full access to your system.
    

    看来高版本的macos用这种方式是无办法搞定了,不过有万能的stackoverflow,就没有解决不了的问题:

    https://stackoverflow.com/questions/46459152/cant-chown-usr-local-for-homebrew-in-osx-10-13-high-sierra

    其实也就是先卸载旧的homebrew,然后再安装新的,虽然曲折了点,但好歹把问题解决了,剩下的流程直接按照flutter doctor提供的命令来执行就可以了。

    相关文章

      网友评论

          本文标题:macos更新flutter出错

          本文链接:https://www.haomeiwen.com/subject/qwxvoqtx.html