Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
621 views
in Technique[技术] by (71.8m points)

xcode - macOS更新后Git无法正常运行(xcrun:错误:无效的活动开发人员路径(/ Library / Developer / CommandLineTools)(Git is not working after macOS Update (xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools))

Last night (November 2018) I updated to macOS Mojave, (this will probably work for Catalina too)

(昨晚(2018年11月)我更新到了macOS Mojave,(这可能也适用于Catalina))

This morning I navigated to my work's code base in Command line on my MacBook pro,

(今天早上,我在MacBook Pro的命令行中导航到工作的代码库,)

typed in "git status" in the repo and received the error:

(在仓库中输入“ git status”并收到错误:)

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
  ask by dustbuster translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The problem is that Xcode Command-line Tools needs to be updated.

(问题是Xcode命令行工具需要更新。)

Go back to your terminal and hit:

(返回您的终端并点击:)

xcode-select --install

You'll then receive:

(然后,您将收到:)

xcode-select: note: install requested for command line developer tools

You will be prompted at this point in a window to update Xcode Command Line tools.

(此时将在窗口中提示您更新Xcode命令行工具。)

(which may take a while)

((可能需要一段时间))

open a new terminal window and your development tools should be returned.

(打开一个新的终端窗口,应该返回您的开发工具。)

Addition: With any major or semi-major update you'll need to update the command line tools in order to get them functioning properly again.

(另外:使用任何主要或半主要更新,您都需要更新命令行工具,以使它们再次正常运行。)

Check Xcode with any update.

(检查Xcode是否有任何更新。)

This goes beyond Mojave...

(这超越了莫哈韦沙漠...)

After that restart your terminal

(之后,重启终端)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...