今天不知道用vue-cli時候下載模板出現(xiàn)
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
還以為vue-cli除了問題,于是 npm uninstall vue-cli 之后重裝vue-cli,還是出現(xiàn)這個問題。 后面查了一下,似乎是git出問題了,只要用到git命令就會彈出這個提示。
納悶了,當時忘記用什么方式安裝git了。 在網(wǎng)上查了千篇一律的用這句命令: xcode-select --install
但是我沒有安裝xcode,那貨 6G 除了下載久之外我的乞丐版筆記本儲存空間吃不消,無奈……
于是查了一下git的安裝地址:
which git
// /usr/bin/git 一般默認安裝地址
cd到 /usr/bin/之后想用 rm 刪除
sudo rm -rf git*
居然提示說 找不到git的地址,這就奇怪了。 算了
接著繼續(xù)查,看到有人用HomeBrew來重新安裝git ,自己索性試了一下
sudo brew install git
過程提示讓我輸入 brew link git ,接著出現(xiàn)了這個問題
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink share/man/man5/gitattributes.5
/usr/local/share/man/man5 is not writable.
解決辦法
$ sudo chown -R $(whoami):admin /usr/local/share/man
接著重新輸入brew link git 就可以了! 記錄一下