Homebrew 安装了两个版本的icu4c

ste*_*esu 17 php macos homebrew node.js icu4c

每当我尝试在 Macnpm --versionnode --versionMac 上运行时,都会收到以下错误:

$> 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
Run Code Online (Sandbox Code Playgroud)

我发现这篇有用的 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
Run Code Online (Sandbox Code Playgroud)

但是这样做之后,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
Run Code Online (Sandbox Code Playgroud)

我发现这篇有用的 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
Run Code Online (Sandbox Code Playgroud)

但是现在NodeJS又坏了!我如何告诉 Homebrew 创建两个链接,一个用于 63.1,一个用于 64.2?或者有没有办法告诉 NodeJS 使用较新的 64.2?

Yve*_*org 0

摆脱brew的node,npm等......

然后在您的用户帐户中像这样安装 nvm 。

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.1/install.sh | bash
Run Code Online (Sandbox Code Playgroud)

安装后,安装你梦想的节点(例如)

nvm install v12    
Run Code Online (Sandbox Code Playgroud)

它将安装 LTS 版本 12 及其 npm。

您还可以安装多个节点,并使用 nvm 轻松切换。

在这里阅读相关内容。特别是关于建立一些出口。

最后,选择你喜欢的php。

pf :我还必须解决brew*&^%@#*与mysql 的冲突问题,并从Oracle 发行版安装hard mysql。