因为没有什么事情要做,我决定在一个星期五下午更新和升级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添加到我的路径很容易,但我不确定如何处理第二部分要求我设置的内容。
** 更新 **
以下是运行ls -l /usr/local/opt/icu4c/lib/
的输出。
total 131128
drwxr-xr-x 6 chris staff 192 Apr 17 15:42 icu
-rw-r--r-- 1 chris staff 27537504 May 31 14:04 libicudata.64.2.dylib
lrwxr-xr-x 1 chris staff 21 Apr 17 15:42 libicudata.64.dylib -> libicudata.64.2.dylib
-r--r--r-- 1 chris staff 27532496 Apr 17 15:42 libicudata.a
lrwxr-xr-x 1 chris staff 21 Apr 17 15:42 libicudata.dylib -> libicudata.64.2.dylib
-r--r--r-- 1 chris staff 2578452 May 31 14:04 libicui18n.64.2.dylib
lrwxr-xr-x 1 chris staff 21 Apr 17 15:42 libicui18n.64.dylib -> libicui18n.64.2.dylib
-r--r--r-- 1 chris staff 4700120 Apr 17 15:42 libicui18n.a
lrwxr-xr-x 1 chris staff 21 Apr 17 15:42 libicui18n.dylib -> libicui18n.64.2.dylib
-r--r--r-- 1 chris staff 61280 May 31 14:04 libicuio.64.2.dylib
lrwxr-xr-x 1 chris staff 19 Apr 17 15:42 libicuio.64.dylib -> libicuio.64.2.dylib
-r--r--r-- 1 chris staff 68744 Apr 17 15:42 libicuio.a
lrwxr-xr-x 1 chris staff 19 Apr 17 15:42 libicuio.dylib -> libicuio.64.2.dylib
-rw-r--r-- 1 chris staff 67124 May 31 14:04 libicutest.64.2.dylib
lrwxr-xr-x 1 chris staff 21 Apr 17 15:42 libicutest.64.dylib -> libicutest.64.2.dylib
-r--r--r-- 1 chris staff 79432 Apr 17 15:42 libicutest.a
lrwxr-xr-x 1 chris staff 21 Apr 17 15:42 libicutest.dylib -> libicutest.64.2.dylib
-r--r--r-- 1 chris staff 174512 May 31 14:04 libicutu.64.2.dylib
lrwxr-xr-x 1 chris staff 19 Apr 17 15:42 libicutu.64.dylib -> libicutu.64.2.dylib
-r--r--r-- 1 chris staff 235368 Apr 17 15:42 libicutu.a
lrwxr-xr-x 1 chris staff 19 Apr 17 15:42 libicutu.dylib -> libicutu.64.2.dylib
-rw-r--r-- 1 chris staff 1578232 May 31 14:04 libicuuc.64.2.dylib
lrwxr-xr-x 1 chris staff 19 Apr 17 15:42 libicuuc.64.dylib -> libicuuc.64.2.dylib
-r--r--r-- 1 chris staff 2498616 Apr 17 15:42 libicuuc.a
lrwxr-xr-x 1 chris staff 19 Apr 17 15:42 libicuuc.dylib -> libicuuc.64.2.dylib
drwxr-xr-x 5 chris staff 160 May 31 14:04 pkgconfig
brew link icu4c
,也许在更新期间没有创建一些符号链接。 - Styxicu4c
是独占的,因此它没有链接到/usr/local
。请显示ls -l /usr/local/opt/icu4c/lib/
的输出。 - Styxls -l /usr/local/opt/icu4c/lib/
的输出。 - MarketHubb-l /usr/local/opt/icu4c/lib/
只显示版本51.1的文件。然而,brew info icu4c
说唯一安装的版本是64.2。你有什么猜测吗?我应该发一个新问题,而不是在这里问吗? - Aram Harrow