Installing node with brew fails on Mac OS Sierra

后端 未结 21 2147
执笔经年
执笔经年 2021-01-30 05: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

相关标签:
21条回答
  • 2021-01-30 06:51

    Upgrading node fixed a problem.

    brew upgrade node 
    
    0 讨论(0)
  • 2021-01-30 06:53

    This was triggered for me after a brew upgrade and brew update ran. I was able to fix it by simply re-installing the two items flagged as problems (which made sense to me):

    brew reinstall node
    brew reinstall icu4c
    
    0 讨论(0)
  • 2021-01-30 06:54

    For me it was apparently a problem with the icu4c installation from brew.

    brew reinstall icu4c
    

    will reinstall icu4c.

    if you don't have it installed,

    brew install icu4c
    
    0 讨论(0)
  • 2021-01-30 06:54

    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
    
    0 讨论(0)
  • 2021-01-30 06:55

    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.

    0 讨论(0)
  • 2021-01-30 06:56

    I recently encountered a similar issue (after doing brew switch node 9.8.0 to downgrade to a previous version of node)

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

    The issue is that node is picky about which version of icu4c it's looking for, and the version I had installed (62) was higher than node was expecting.

    To fix, I made sure I had version 60 of icu4c selected.

    First I found which versions I had with brew info icu4c, then did brew switch icu4c 60.2 to select the one node was expecting.

    0 讨论(0)
提交回复
热议问题