2

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

This is the error I get in VS Code's terminal. There are error squiggles under the "#include <stdio.h>" line.

This is after I upgraded to Mac OS Monterey.

What is the reason for this error and what is the solution?

  • 2
    You probably need to (re?)install XCode command-line tools. This might help: https://www.freecodecamp.org/news/install-xcode-command-line-tools/ – tromgy Nov 01 '21 at 10:35
  • You can try this solution https://stackoverflow.com/a/64619274/10621865 . – Faisal Afroz Nov 02 '21 at 22:34

1 Answers1

2

When upgrading your Mac OS, sometimes the code command-line tools stop working. This can be resolved by running this in the terminal:

sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer

If you don't have Xcode installed you should do:

xcode-select --install

which will install the command-line tools without having Xcode.

pors
  • 3,345
  • 29
  • 28