💻我的本儿:Mac电脑 M1芯片 Big_Sur系统 11.1版本
🤓问题起源:需要用npm安装whistle代理
🤔我的想法:
1、用Mac本自带的Homebrew包管理工具安装npm
2、安装好npm后,使用npm安装whistle
理论上: $ npm install whistle
实际上:问题出现了!
Failed to download resource “icu4c”☹️
🤯资料参考:
https://github.com/Homebrew/legacy-homebrew/issues/36716
https://www.jianshu.com/p/48971d122a77
https://www.bilibili.com/read/cv9809587/
😧尝试方法:
1、brew install node --without-icu4c --build-from-source
==>Fail,Error: invalid option: --without-icu4c
2、安装npm报无法下载icu4c的错,琢磨着自己去icu4c官网下载,再copy到homebrew路径下。
==>Fail,发现没有对应的arm64 big_Sur版本。
icu4c官网: https://github.com/unicode-org/icu/releases/tag/release-69-1
🤩最终解决方法:
在Homebrew中重装两个模块,gettext和pcre2,运行如下指令:
$ brew reinstall gettext
$ brew reinstall pcre2
🥳🥳成功安装npm和whistle,启动whistle没有问题啦:
🧐思考总结:
1、解决以后也可以正常安装其他的包,所以如果在安装其他包也遇到Failed to download resource "icu4c"这个问题时可以尝试下;
2、还没有搞懂为啥重新安装gettext和pcre2就可以了,后续有时间会补充。另外有了解的也可以评论指教~