报错
dyld[98585]: Library not loaded: /opt/homebrew/opt/icu4c/lib/libicui18n.71.dylib Referenced from: /opt/homebrew/Cellar/php@7.0/7.0.33_6/bin/php Reason: tried: '/opt/homebrew/opt/icu4c/lib/libicui18n.71.dylib' (no such file), '/usr/local/lib/libicui18n.71.dylib' (no such file), '/usr/lib/libicui18n.71.dylib' (no such file), '/opt/homebrew/Cellar/icu4c/70.1/lib/libicui18n.71.dylib' (no such file), '/usr/local/lib/libicui18n.71.dylib' (no such file), '/usr/lib/libicui18n.71.dylib' (no such file)[1] 98585 abort php -v
查看了/opt/homebrew/opt/icu4c/lib/目录下是libicui18n.70.dylib
第一次解决
$brew switch icu4c 71Error: Unknown command: switch
回滚
#切换目录cd $(brew --prefix)/Homebrew/Library/Taps/homebrew/homebrew-core/Formula #git查看提交版本git log --follow icu4c.rb #回滚到71版本,没有看到71的提交记录,选择了最初的一个提交版本回滚git checkout -b icu4c-71.1 xxxx(版本号) #brew重新安装icu4cbrew reinstall ./icu4c.rb
失败
又参考了记录一次brew 回滚 icu4c 操作仍然不行
最后解决
brew update && brew upgrade
来源地址:https://blog.csdn.net/qq_44157558/article/details/127033306