43

For my case, i only get the error when opening accessing terminal (zsh) via VS Code.

Upon opening VS Code terminal OR running node command, i get this error:

dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.63.dylib
  Referenced from: /usr/local/bin/node
  Reason: image not found
[1]    4506 abort      node

However, it runs fine when running via iTerm. Tried running brew update and brew upgrade and a few other recommended answers.

Anything am i missing?

jaanhio
  • 743
  • 1
  • 5
  • 17
  • New install of VS code and new macbook - same issue. macOS Mojave and VS 1.31.0 – Jason Feb 13 '19 at 04:12
  • [2020 answer] Here is the related issue answer: https://stackoverflow.com/a/63955091/7059946 – mialdi98 Sep 18 '20 at 14:07
  • 2 years 6 months later, i encountered this problem again and am glad that @Jason's answer (https://stackoverflow.com/a/54662431/8096221) helped me resolve this again – jaanhio Aug 29 '21 at 01:41

4 Answers4

44

Piggybacking off Jason's answer, another option is to just run

brew upgrade node
ihake
  • 1,651
  • 1
  • 16
  • 29
  • 2
    Work! 10.14.6 macOS – Falselight Oct 23 '19 at 17:48
  • I got this error, but this answer still worked for me (solved the problem despite the error message) `Error: No such file or directory - /usr/local/Cellar/yarn/1.12.3` – stevec Feb 26 '20 at 04:45
  • Yes! Thank you! I had already run `brew upgrade` and `brew cleanup` (or whatever it is) and was panicking! – Liz Dec 17 '20 at 05:09
33

Found the answer here

Run this

brew uninstall node icu4c
brew install node
Jason
  • 14,518
  • 15
  • 63
  • 105
  • 3
    Found the answer here--thanks! `brew uninstall --ignore-dependencies node icu4c` avoided issues with several related dependencies, including postgresql. – SexxLuthor Apr 25 '19 at 05:12
19

You might follow these steps.

> which node
/usr/local/bin/node
> rm /usr/local/bin/node
> brew unlink node
> brew link --overwrite node

This should solve the problem.

Rakesh K
  • 1,220
  • 1
  • 13
  • 37
  • 1
    This is the only answer which worked (...like a charm)! – david Nov 10 '19 at 23:23
  • 1
    For me, I ran these steps, but I got the same error afterwards. So I also `brew uninstall node` and then `brew install node` and everything worked again. – Doomd Jul 26 '20 at 20:40
  • 1
    Followed these steps. The problem was not solved. `brew upgrade node` helped me. (macOS Big Sur) – blackchestnut Nov 11 '21 at 16:36
9

A brew reinstall icu4c fixed the problem on macOS 10.15.6.

It also helps to watch your logs when starting a broken package (node, pg, etc. – for pg it's tail -f /usr/local/var/log/postgresql@11.log – not the server log).

medik
  • 1,019
  • 12
  • 15