我使用自制(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,但问题仍然存在
当前回答
结果我和@Grey Black一样,不得不安装icu4c的v62.1版本。其他方法都不管用。
但是,酿造开关icu4c 62.1仅在过去安装过62.1的情况下才能工作。如果你还没有,就需要做更多跑腿的工作。Homebrew不容易安装以前版本的公式。
我是这样做的:
We first need a deep clone of the Homebrew repo. This may take a while: git -C $(brew --repo homebrew/core) fetch --unshallow brew log icu4c to track down a commit that references 62.1; 575eb4b does the trick. cd $(brew --repo homebrew/core) git checkout 575eb4b -- Formula/icu4c.rb brew uninstall --ignore-dependencies icu4c brew install icu4c You should now have the correct version of the dependency! Now just to... git reset && git checkout . Cleanup your modified recipe. brew pin icu4c Pin the dependency to prevent it from being accidentally upgraded in the future
如果你决定在某个时候升级它,一定要运行brew unpin icu4c
其他回答
我已经尝试了这里的许多建议,最后酿造升级php是对我有用的,但似乎这个问题无处不在
[2022 Build It Yourself Edition]
适用于我的Mac OS 11.6.8大苏尔。
$ wget https://github.com/unicode-org/icu/releases/download/release-69-1/icu4c-69_1-src.tgz
$ # In Finder, copy from Downloads/ to your home directory
$ tar xzvf icu4c-69_1-src.tgz
$ cd icu/source
$ ./configure
$ make
$ make install
在那之后,node和npm又开始工作了。
参考文献
@Taher的回答 https://stackoverflow.com/a/63045892/16681513
在我的例子中,发生这种情况是因为icu4c升级到版本63,但我在本地安装的postgres映像仍然引用icu4c 62.1。因此,我不得不改变使用的icu4c版本:
brew info icu4c
brew switch icu4c <version>
其中version是info返回的已安装版本。
这为我解决了问题:
brew upgrade node
我通过更新所有R包来解决int:
update.packages(checkBuilt = TRUE, ask = FALSE)