npm install 時(shí)出現(xiàn)上述問題,解決方案如下:
1、命令行輸入xcode-select --print-path查看 command-line tools 的安裝路徑,一般情況下應(yīng)該是:/Library/Developer/CommandLineTools
2、然后輸入sudo rm -r -f /Library/Developer/CommandLineTools刪除 command-line tools 工具
3、最后輸入xcode-select --install,重新安裝xcode-select 工具
4、重新 npm install 安裝依賴就可以了。
參考文章:https://blog.csdn.net/qq_41070393/article/details/110862053