Installing node with brew fails on Mac OS Sierra

2020-05-12 04:50发布

I'm trying to install node with homebrew on macOS Sierra. I run

 brew install node

After a seemingly successful install I get the following when trying to run node:

dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.58.dylib
  Referenced from: /usr/local/bin/node
  Reason: image not found
Abort trap: 6

20条回答
狗以群分
2楼-- · 2020-05-12 05:10

This is the series of incantations that eventually worked for me based on this link suggested by @robertklep and @vovkasm.

brew uninstall --force node
brew uninstall icu4c && brew install icu4c
brew unlink icu4c && brew link icu4c --force
brew install node

I'm not sure if they're all needed, but given that I can't get my machine in the previous state... I'll just leave this info here, maybe it'll be useful for somebody else.

查看更多
男人必须洒脱
3楼-- · 2020-05-12 05:10

brew uninstall --force node
brew uninstall --ignore-dependencies icu4c
brew unlink icu4c && brew link icu4c --force
brew install node

查看更多
爷、活的狠高调
4楼-- · 2020-05-12 05:12

Upgrading node fixed a problem.

brew upgrade node 
查看更多
等我变得足够好
5楼-- · 2020-05-12 05:12

Try restarting your machine. That helped me.

查看更多
叛逆
6楼-- · 2020-05-12 05:14

Nothing worked for me but running this worked

brew link --overwrite node
查看更多
够拽才男人
7楼-- · 2020-05-12 05:16

I found a solution that works great over here. I'll briefly give the commands below.

First, cd into the homebrew formula directory:

cd $(brew --prefix)/Homebrew/Library/Taps/homebrew/homebrew-core/Formula

Git log:

git log --follow icu4c.rb

Choose the commit hash that matches the version you need. I needed version 61.1, thus chose the 6d9815 commit:

git checkout -b icu4c-61.1 6d9815

Reinstall:

brew reinstall ./icu4c.rb

Switch:

brew switch icu4c 61.1

That fixed it for me.

Credit: hanxue

查看更多
登录 后发表回答