美文网首页
git提交代码时报错:xcrun: error: invalid

git提交代码时报错:xcrun: error: invalid

作者: 管乐_VICTOR | 来源:发表于2019-08-21 14:05 被阅读0次

一、背景

使用命令行提交代码到git时,出现报错
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

二、分析

1.可能是之前卸载了Xcode,然后重装的时候造成的路径错误。 invalid active path

三、处理

1.可以通过终端命令来指定一个路径

xcode-select --switch /Library/Developer/CommandLineTools

2.重置默认开发工具路径

sudo xcode-select -r

四、结论

然后打印一下

//执行重置命令
sudo xcode-select -r
xcode-select -p
// 打印结果如下:
/Applications/Xcode.app/Contents/Developer

OK,可以继续使用了。

相关文章

网友评论

      本文标题:git提交代码时报错:xcrun: error: invalid

      本文链接:https://www.haomeiwen.com/subject/ekibsctx.html