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:03

This error was given to me after migrating machines.

Even though everything was installed, when I went to check node -v or npm version, I'd get this error.

What fixed it was brew reinstall icu4c.

查看更多
Viruses.
3楼-- · 2020-05-12 05:03

I removed export PATH="/usr/local/opt/icu4c/bin:$PATH" from my ~/.bash_profile file and it fixed my problem.

My error was:

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

My /usr/local/opt/icu4c/lib contains libicui18n.64.dylib

查看更多
孤傲高冷的网名
4楼-- · 2020-05-12 05:05

It's as easy as a common software, just download installation package from official site:NodeJS

and then download a recommended version(currently 8.11.3, end with .pkg), install it as a common software, then u can use it. I tried so many methods, and only this works for me.

查看更多
太酷不给撩
5楼-- · 2020-05-12 05:06

I had the same problem with my local php installation.

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

Solved the problem with this command. (check your version)

brew link --overwrite --force php@7.1
查看更多
我只想做你的唯一
6楼-- · 2020-05-12 05:08

Seems file /usr/local/opt/icu4c/lib/libicui18n.58.dylib does not exists in you system.

Please ensure that icu4c installed with Homebrew.

  1. brew info icu4c
  2. If already installed, try reinstall: brew reinstall icu4c
  3. If not installed, try install: brew install icu4c
查看更多
SAY GOODBYE
7楼-- · 2020-05-12 05:09

For high seirra, just "brew upgrade" makes magic!

查看更多
登录 后发表回答