我决定在星期五的下午更新和升级Homebrew(因为为什么不这样做),它似乎导致缺少库,这影响了我运行几乎所有东西的能力(PHP,Laravel Valet,Node等)。 )每个错误消息都是相同的,因此我希望这是一个简单的解决方法,但是我不确定从哪里开始。
Chriss-MacBook-Pro-2:~ chris$ node --version
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.61.dylib
Referenced from: /usr/local/bin/node
Reason: image not found
Abort trap: 6
Chriss-MacBook-Pro-2:~ chris$ valet
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.61.dylib
Referenced from: /usr/local/bin/php
Reason: image not found
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.61.dylib
Referenced from: /usr/local/bin/php
Reason: image not found
Password:
Sorry, try again.
Password:
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.61.dylib
Referenced from: /usr/local/bin/php
Reason: image not found
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.61.dylib
Referenced from: /usr/local/bin/php
Reason: image not found
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.61.dylib
Referenced from: /usr/local/bin/php
Reason: image not found
/usr/local/bin/valet: line 54: 729 Abort trap: 6 php "$DIR/cli/valet.php" "$@"
Chriss-MacBook-Pro-2:~ chris$ php --version
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.61.dylib
Referenced from: /usr/local/bin/php
Reason: image not found
Abort trap: 6
他们似乎都在寻找/usr/local/opt/icu4c/lib/libicui18n.61.dylib
中的图书馆
**编辑**
我运行了 Styx 建议的brew命令,这是输出:
Chriss-MacBook-Pro-2:~ chris$ brew link icu4c
Warning: Refusing to link macOS-provided software: icu4c
If you need to have icu4c first in your PATH run:
echo 'export PATH="/usr/local/opt/icu4c/bin:$PATH"' >> ~/.bash_profile
echo 'export PATH="/usr/local/opt/icu4c/sbin:$PATH"' >> ~/.bash_profile
For compilers to find icu4c you may need to set:
export LDFLAGS="-L/usr/local/opt/icu4c/lib"
export CPPFLAGS="-I/usr/local/opt/icu4c/include"
在我的路径中添加 icu4c 很容易,但是我不确定第二部分要我设置的处理方法
答案 0 :(得分:2)
您的icu4c
似乎已升级,但是您的php / node仍然引用旧版本。
您可以:
重新安装取决于icu4c
的软件:
brew uses --installed icu4c | xargs brew reinstall
切换为使用icu4c
的旧版本:
brew switch icu4c 61.2