dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.60.dylib

使用brew 安装 yarn 之后 ,node环境报错

dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.60.dylib
Referenced from: /usr/local/opt/node@8/bin/node
Reason: image not found

查找很多资料,还是没有完全解决,经过的自己的实践,解决了我的问题,希望对你有帮助。

解决方法

brew list  # 查看安装的软件
brew uninstall --ignore-dependencies node icu4c  # 卸载软件
brew uninstall nvm  #卸载nvm
brew uninstall node[@8](https://my.oschina.net/u/147515)  #卸载node[@8](https://my.oschina.net/u/147515)
brew uninstall yarn   #卸载 yarn

安装软件
brew install nvm
==> Caveats
Please note that upstream has asked us to make explicit managing
nvm via Homebrew is unsupported by them and you should check any
problems against the standard nvm install method prior to reporting.

You should create NVM's working directory if it doesn't exist:

  mkdir ~/.nvm

Add the following to ~/.zshrc or your desired shell
configuration file:

  export NVM_DIR="$HOME/.nvm"
  [ -s "/usr/local/opt/nvm/nvm.sh" ] && . "/usr/local/opt/nvm/nvm.sh"  # This loads nvm
  [ -s "/usr/local/opt/nvm/etc/bash_completion" ] && . "/usr/local/opt/nvm/etc/bash_completion"  # This loads nvm bash_completion

You can set $NVM_DIR to any location, but leaving it unchanged from
/usr/local/opt/nvm will destroy any nvm-installed Node installations
upon upgrade/reinstall.

Type `nvm help` for further information.

Bash completion has been installed to:
  /usr/local/etc/bash_completion.d
==> Summary
?  /usr/local/Cellar/nvm/0.34.0: 7 files, 141.7KB, built in 8 seconds
  • 根据提示,创建文件,配置参数

       mkdir ~/.nvm
    	Add the following to ~/.zshrc or your desired shell
      configuration file:
    
        export NVM_DIR="$HOME/.nvm"
        [ -s "/usr/local/opt/nvm/nvm.sh" ] && . "/usr/local/opt/nvm/nvm.sh"  # This loads nvm
        [ -s "/usr/local/opt/nvm/etc/bash_completion" ] && . "/usr/local/opt/nvm/etc/bash_completion"  # This loads nvm bash_completion
    
  • 再使用nvm 安装node

       ~ nvm list
      			N/A
      iojs -> N/A (default)
      node -> stable (-> N/A) (default)
      unstable -> N/A (default)
      nvm_list_aliases:36: no matches found: /Users/caonn/.nvm/alias/lts/*
      ➜  ~ nvm install v8.11.2
      Downloading and installing node v8.11.2...
      Downloading https://nodejs.org/dist/v8.11.2/node-v8.11.2-darwin-x64.tar.xz...
      ######################################################################## 100.0%
      Computing checksum with shasum -a 256
      Checksums matched!
      Now using node v8.11.2 (npm v5.6.0)
      Creating default alias: default -> v8.11.2
      ➜  ~ node -v
      v8.11.2
      ➜  ~ npm -v
      5.6.0
      ➜  ~
    

测试后,可以正常使用。

##【总结】

1.nvm,nodejs,brew 软件使用不熟悉,liunx原理不熟。
2.解决思路,把所有相关软件卸载后,重新安装。
3.后面的node版本都是用nvm 管理。

转载于:https://my.oschina.net/u/263874/blog/3077809

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值