Reputation: 11
I have installed 3 different versions of node, and when I try to initialise a new project using npm create ..., I encountered this error:
dyld\[68210\]: Library not loaded: /opt/homebrew/opt/icu4c/lib/libicui18n.74.dylib
Referenced from: \<24066746-1ED4-3611-A914-272C96B743A8\> /opt/homebrew/Cellar/node@16/16.20.2_1/bin/node
Reason: tried: '/opt/homebrew/opt/icu4c/lib/libicui18n.74.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/opt/icu4c/lib/libicui18n.74.dylib' (no such file), '/opt/homebrew/opt/icu4c/lib/libicui18n.74.dylib' (no such file), '/opt/homebrew/Cellar/icu4c@76/76.1_1/lib/libicui18n.74.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/Cellar/icu4c@76/76.1_1/lib/libicui18n.74.dylib' (no such file), '/opt/homebrew/Cellar/icu4c@76/76.1_1/lib/libicui18n.74.dylib' (no such file)
And then I decided to check which version of node was linked, and ran
node --version
which again returned:
dyld[71989]: Library not loaded: /opt/homebrew/opt/icu4c/lib/libicui18n.74.dylib
Referenced from: <24066746-1ED4-3611-A914-272C96B743A8> /opt/homebrew/Cellar/node@16/16.20.2_1/bin/node
Reason: tried: '/opt/homebrew/opt/icu4c/lib/libicui18n.74.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/opt/icu4c/lib/libicui18n.74.dylib' (no such file), '/opt/homebrew/opt/icu4c/lib/libicui18n.74.dylib' (no such file), '/opt/homebrew/Cellar/icu4c@76/76.1_1/lib/libicui18n.74.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/Cellar/icu4c@76/76.1_1/lib/libicui18n.74.dylib' (no such file), '/opt/homebrew/Cellar/icu4c@76/76.1_1/lib/libicui18n.74.dylib' (no such file)
tl;dr: I tried initializing a new project using npm create but encountered an unexpected error, which further led me to encountering the same error when I was investigating my node version
Upvotes: 0
Views: 19
Reputation: 11
What worked for me:
brew update
brew upgrade icu4c
brew link --force icu4c
brew reinstall node
After this, both my node --version
and npm create
commands worked as expected
Upvotes: 1