npm 安裝套件遇到「Library not loaded」錯誤訊息,更新 node.js 版本即可解決
Photo by Ehud Neuhaus on StockSnap |
錯誤狀況
npm 安裝套件遇到錯誤訊息,直接呼叫 node 發現也是相同錯誤訊息
% node -v
dyld[78276]: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.67.dylib
Referenced from: /usr/local/Cellar/node/15.3.0/bin/node
Reason: tried: '/usr/local/opt/icu4c/lib/libicui18n.67.dylib' (no such file), '/usr/local/lib/libicui18n.67.dylib' (no such file), '/usr/lib/libicui18n.67.dylib' (no such file), '/usr/local/Cellar/icu4c/70.1/lib/libicui18n.67.dylib' (no such file), '/usr/local/lib/libicui18n.67.dylib' (no such file), '/usr/lib/libicui18n.67.dylib' (no such file)
解決方式
更新 node.js 版本,在終端機輸入指令
% brew upgrade node
安裝完成,在終端機輸入指令,確認沒有問題
% node -v
結果可以顯示版本號(例如:v17.6.0),代表已經解決
參考資料
- 解決 dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.64.dylib
- node.js - dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.62.dylib error running php after installing node with brew on Mac - Stack Overflow
留言
張貼留言