简体   繁体   中英

VS Code C Error - Invalid Active Developer Path

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?

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.

The fix, luckily, is pretty straight forward. Install the Xcode toolkit, Even if you had it installed before. you might have to re-register it or update it to the latest version.

$ xcode-select --install

If that doesn't work, force it to reset. You'll need sudo access for this one.

$ sudo xcode-select --reset

安装 xcode 解决了这个问题。

trying to learn python:

I cant install python on my mac,some error when installing, tried donwloding all version for mac, still same error: https://www.python.org/downloads/macos/

when debuggong in VS Code: manually-specify-an-interpreter

https://code.visualstudio.com/docs/python/environments#_manually-specify-an-interpreter

tried to install an interpreter, failed

checked installed version on my mac, only found a path in xcrun: error: invalid active developer path, problem after zsh update for flutter

this worked out xcode-select --install

This helps me fixing

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM