mac安装Command Line Tools 后使用git报错:xcrun: error: active developer path does not exist

这篇博客讲述了遇到xcrun错误提示'activedeveloperpath'不存在的情况,原因是Xcode被卸载但路径未更新。解决方案是使用`sudo xcode-select --switch`命令切换到正确的Xcode命令行工具路径,或者安装独立的命令行开发工具。通过`xcode-select -p`检查路径已更改为'/Library/Developer/CommandLineTools',并确认git版本为2.24.3。
$ git version
xcrun: error: active developer path ("/Applications/Xcode.app/Contents/Developer") does not exist
Use `sudo xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools, or use `xcode-select --install` to install the standalone command line developer tools.
See `man xcode-select` for more details.

错误显示路径不存在,xcode-select -p  打印出来的路径也是这个,可能因为我电脑以前装过Xcode,后来卸载了路径还是之前的,重置系统默认开发工具路径就好了

$ xcode-select -p
/Applications/Xcode.app/Contents/Developer
$ sudo xcode-select -r
$ xcode-select -p
/Library/Developer/CommandLineTools
$ git version
git version 2.24.3 (Apple Git-128)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值