Hey everyone, I’m having a weird issue with Node.js and npm. I’ve got multiple Node versions installed, but when I try to start a new project using npm create, I get this error about a missing library:
dyld[1234]: Library not loaded: /opt/homebrew/opt/icu4c/lib/libicui18n.74.dylib
Referenced from: /opt/homebrew/Cellar/node@16/16.20.2_1/bin/node
Reason: file not found
I tried to check my Node version with node --version, but got the same error. It looks like it’s trying to find this library in a bunch of places but can’t.
Has anyone run into this before? Any ideas on how to fix it? I’m pretty stuck and can’t even use npm right now. Thanks for any help!
hey pete, i had a similar issue. try running ‘brew upgrade icu4c’ in terminal. it might update the missing library. if that doesn’t work, maybe try uninstalling and reinstalling node with homebrew. good luck!
I’ve dealt with similar library issues before. Here’s a potential fix that worked for me:
Check if the icu4c package is installed and up to date:
brew info icu4c
If it’s not installed or outdated, run:
brew install icu4c
or
brew upgrade icu4c
Then, try to force-link it:
brew link icu4c --force
After that, you might need to rebuild Node.js to use the updated library:
brew uninstall node
brew install node
Restart your terminal and try running npm again. If issues persist, you may need to check your PATH and ensure it’s pointing to the correct Node installation. Hope this helps resolve your problem!
I’ve encountered this issue before, and it can be frustrating. In my experience, the problem often stems from mismatched library versions or incomplete installations. Here’s what worked for me:
First, I’d suggest running ‘brew doctor’ to check for any general Homebrew issues. Then, try ‘brew upgrade node’ to ensure you have the latest version.
If that doesn’t solve it, you might need to manually link the icu4c library. I fixed mine by running:
brew link icu4c --force
This creates the necessary symlinks. Afterward, I restarted my terminal and everything worked smoothly.
If you’re still having trouble, you could try completely removing and reinstalling Node:
brew uninstall --force node
brew install node
Hope this helps! Let us know if you manage to resolve it.