MacOS – How to solve the problem of “invalid active developer path” when attempting to use Git on VSCode

command linemacosterminalvisual-studio-code

How do I fix this issue while on VS Code?

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

I've updated my bash profile

Best Answer

xcode-select --install

This installs or updates Command Line Tools. It can be done manually too, by downloading the tools from Developer Website.

You might need to point it to the install location of the tools too.

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

Then restart the Terminal/ VSCode.