每当我尝试运行npm --version
或node --version
在我的 Mac 上运行时,我都会收到以下错误:
$> node --version
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.63.dylib
Referenced from: /usr/local/bin/node
Reason: image not found
Abort trap: 6
我发现这篇有用的 SO 帖子建议链接适当的版本,并解决了我的问题:
$> brew switch icu4c 63.1
Cleaning /usr/local/Cellar/icu4c/64.2
Cleaning /usr/local/Cellar/icu4c/63.1
Opt link created for /usr/local/Cellar/icu4c/63.1
然而,在这样做之后,PHP停止工作:
$> tail /usr/local/var/log/php-fpm.log
Reason: image not found
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.64.dylib
Referenced from: /usr/local/opt/php/sbin/php-fpm
Reason: image not found
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.64.dylib
Referenced from: /usr/local/opt/php/sbin/php-fpm
Reason: image not found
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.64.dylib
Referenced from: /usr/local/opt/php/sbin/php-fpm
Reason: image not found
我发现这篇有用的 SO 帖子建议链接适当的版本,并解决了我的问题:
$> brew switch icu4c 64.2
Cleaning /usr/local/Cellar/icu4c/64.2
Cleaning /usr/local/Cellar/icu4c/63.1
Opt link created for /usr/local/Cellar/icu4c/64.2
但是现在 NodeJS 又坏了!如何告诉 Homebrew 创建两个链接,一个用于 63.1,一个用于 64.2?或者有没有办法告诉 NodeJS 使用更新的 64.2 来代替?