我使用自制(Mojave)安装节点,之后php停止工作,如果我尝试运行php -v,我会得到这个错误:
php -v
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.62.dylib
Referenced from: /usr/local/bin/php
Reason: image not found
我尝试卸载node和icu4c,但问题仍然存在
我使用自制(Mojave)安装节点,之后php停止工作,如果我尝试运行php -v,我会得到这个错误:
php -v
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.62.dylib
Referenced from: /usr/local/bin/php
Reason: image not found
我尝试卸载node和icu4c,但问题仍然存在
当前回答
我的问题:
# npm install -g canvas
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.64.dylib
Referenced from: /usr/local/opt/node@8/bin/node
Reason: image not found
现在20210118,经过多次尝试:
...
brew reinstall https://raw.githubusercontent.com/Homebrew/homebrew-core/master/Formula/icu4c.rb
brew upgrade npm
brew install node
brew uninstall --ignore-dependencies node@8 icu4c
brew install icu4c
...
最终解决方案为:
重新安装NPM
其他回答
我的问题:
# npm install -g canvas
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.64.dylib
Referenced from: /usr/local/opt/node@8/bin/node
Reason: image not found
现在20210118,经过多次尝试:
...
brew reinstall https://raw.githubusercontent.com/Homebrew/homebrew-core/master/Formula/icu4c.rb
brew upgrade npm
brew install node
brew uninstall --ignore-dependencies node@8 icu4c
brew install icu4c
...
最终解决方案为:
重新安装NPM
实际上,我直接在自制网页上找到了解决方案:https://docs.brew.sh/Common-Issues
升级macOS会导致以下错误:
/usr/local/opt/icu4c/lib/libicui18n.54.dylib:库未加载 配置错误:不能找到libz 在macOS升级后,可能需要重新安装Xcode命令行工具并酿造升级所有已安装的公式:
xcode-select --install
brew upgrade
在我的案例中,问题与升级操作系统无关,但解决方案很有效。
为了降级,我不得不从源代码(MacOS Mojave)重新编译
$ wget https://ssl.icu-project.org/files/icu4c/62.1/icu4c-62_1-src.tgz
$ tar xvfz icu4c-62_1-src.tgz
$ cd icu/sources
$ ./configure
$ make
$ make install
Brew update && Brew upgrade对我来说很有效
在OSX 10.15.4上运行xcode-select——install修复了这个问题。