芯が強い人になるESTJ-A

# 解决mac下出现"xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools)..的问题

IT開発 Tags: 无标签 阅读: 209

报错是一种常态,解决问题是一种态度。
电脑:mbp2015,宝宝想买M1 的16寸的,32GB内存条的,1TB SSD的,i9的。买买买。。。估计要等我2021年年底考完topik看看成绩才知道了。flag先立好,考出topik5就买,考不出只能继续使用拖拉机2015
版本:mojave

前段时间刚升级了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/xcrunn") (RuntimeError)

我自己也是google了一下,花了点时间,解决了。
截屏2021-03-14 15.25.13.jpg

查了一会也不知道具体的原因,但是找到了解决方案

1.万能的重装

终端输入 : xcode-select --install

成功后查一下,git的版本问题,有人说是git版本。
输入:git -h
正确显示之后,
继续你之前的安装即可。