Problem background
System: macOS Catalina 10.15.4
Background: Use vue-cli to create a project
Error: gyp: No Xcode or CLT version detected
This is the situation I encountered, for reference only~
Tips : You can directly see the problem and solve it~
Problem Description
Look for the special reminder about mac os 10.15 on nodejs official github and found that it is node-gyp
needed Xcode Command Line Tools
, but the machine has been uninstalled for a long time Xcode
. The reason is no other reason. It is too bad ~ this version of the system makes me unable to use vscode debug c++ now (the reason may be system identification The breakpoint is broken, but it will be automatically ignored. It hasn’t been solved yet, so I’ll beg for help from the big guys.), I can only do a wave of Clion. By the
way, the official document tells us how to detect whether the machine has tools and three options for installing tools. The first is to install Xcode, so I choose the second:
With the much smaller Xcode Command Line Tools via
xcode-select --install
It xcode-select --install
may not work directly , so I read some answers and found that the official document also gave at the end that if the above method does not work, it can be sudo rm -rf $(xcode-select -print-path)
solved by directly entering the administrator password. If there is no output, it is normal, and then proceed xcode-select --install
.
problem solved
$ sudo rm -rf $(xcode-select -print-path)
$ xcode-select --install
Reference link
https://github.com/nodejs/node-gyp/blob/master/macOS_Catalina.md
https://www.cnblogs.com/zhennann/p/12272058.html
If there are mistakes or not rigorous, please correct me, thank you very much.
My blog: http://breadhunter.gitee.io