Avatar ·

dyld错误:未加载库:libicui18n.62.dylib,通过Homebrew安装Node.js后出现

大家好!我是PHP新手,使用Mac。今天决定通过Homebrew安装Node.js(命令`brew install node`),之后我的PHP就无法工作了。尝试运行任何脚本,例如: ```php ``` 终端中收到错误: ``` dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.62.dylib Referenced from: /usr/local/bin/php Reason: image not found ``` PHP也是通过Homebrew安装的。安装Node之前一切正常。可能是Homebrew更新了某些库,导致PHP找不到正确版本的icu4c。我尝试通过`brew reinstall php`重新安装PHP,但没有帮助。我的Mac运行macOS Monterey。 请问如何修复这个错误?提前感谢! <<>>

错误原因

问题是由于Homebrew在安装Node.js时更新了icu4c库到新版本,而PHP仍然引用旧版本。