【发布时间】:2019-12-02 20:49:10
【问题描述】:
每当我尝试在我的 Mac 上运行 npm --version 或 node --version 时,都会收到以下错误:
$> 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
我发现 this helpful SO post 建议链接适当的版本,并解决了我的问题:
$> 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
我发现 this helpful SO post 建议链接适当的版本,并解决了我的问题:
$> 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 创建 both 链接,一个用于 63.1,一个用于 64.2?或者有没有办法告诉 NodeJS 改用较新的 64.2?
【问题讨论】:
-
如果有办法让 Homebrew 链接库的两个版本(它们链接到磁盘上的不同位置,所以应该是可能的)那么我仍然对解决方案感兴趣——但是我'现在已经找到了解决我的问题的方法。我将 NodeJS 更新到版本 12.6.0,它使用了更新的 icu4c 库。
标签: php node.js macos homebrew icu4c