Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing node with brew fails on Mac OS Sierra

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 
like image 920
mircealungu Avatar asked May 04 '17 10:05

mircealungu


People also ask

Can I install node with Homebrew?

Use Homebrew to install Node. js on MacOS. Homebrew is a better way to manage various packages on your Mac.

Can I run a node on a Mac?

To write and run a NodeJS program on mac, first download and install the LTS version of NodeJS from its official website. After installation, create a new JavaScript(. js) file, write some code inside it, and run the “node fileName. js” command in the terminal.

Does NPM work on Mac?

You should have some familiarity with the Mac Terminal application since you'll need to use it to install and test Node and NPM. You'll also need the Terminal to use Node. js and NPM. The Terminal application is located in the Utilities folder in the Applications folder.


2 Answers

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.

like image 144
mircealungu Avatar answered Nov 03 '22 10:11

mircealungu


In my case, brew upgrade node resolve the problem :)

like image 27
ice6 Avatar answered Nov 03 '22 11:11

ice6