提交代码时报xcrun: error: invalid active developer path, missing xcrun错误

笔者昨天晚上下班将Mac升级了下系统,升级到了Mac10.14.6。

【这是导致提交代码报xcrun: error: invalid active developer path, missing xcrun错误的罪魁祸首】

升级后的版本如下所示:
在这里插入图片描述
命令行报错:

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

解决方法的思路:

将报错copy下来,而后在后面加上谷歌搜索技巧

不懂谷歌搜索技巧的朋友可以看:https://blog.csdn.net/weixin_43606158/article/details/100531733

最终的搜索信息为:

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun site: https://git-scm.com/

备注:site: 后面的为你要在哪个限定区域内搜索

在这里插入图片描述

问题的原因:

少了系统需要的运行库,运行下发命令后会自动安装

最终总结出来的此问题的解决方案:

重装xcode command line:

$ xcode-select --install

如果没有解决问题,请再执行下面的命令:

$ sudo xcode-select -switch /

如有任何疑惑或者什么问题请在下发评论,十二小时之内笔者会回复~

发布了280 篇原创文章 · 获赞 2324 · 访问量 310万+

猜你喜欢

转载自blog.csdn.net/weixin_43606158/article/details/100731182
今日推荐