解決mac下出現"xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools)..的問題

 

前段時間剛升級了macOS,今天在終端使用Git的時候報了一個詭異的錯:Failed to extract git version from `git --version` ("xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun\n") (RuntimeError)

查了一會也不知道具體的原因,但是找到了解決方案

1.萬能的重裝

終端輸入 :     xcode-select --install

2.切換路徑(我用的是這個方法

終端輸入:      sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

然後輸入密碼執行命令即可

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章