node-gyp,mac,No Xcode or CLT version detected! 报错,npm

2020-11-06 02:00:06

参考链接  Mac 解决 gyp: No Xcode or CLT version detected! 报错


Mac解决:xcode-select: error: command line tools are already installed, use "Software Update" to install updates


我的macOS版本是macOS Catalina 10.15.2

在执行npm install下载项目的依赖包的时候出现的gyp报错,报错内容如下:
No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'.No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'.gyp: No Xcode or CLT version detected!gyp ERR! configure errorgyp ERR! stack Error: `gyp` failed with exit code: 1

后面还有一长串,就不全粘在这里了,主要的就是xcode出现错误,本人也是个小白,在网上搜了很久,大家给的解决方案大部分都是执行指令:

xcode-select --install


1、因为node项目终端报错:

No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'.No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'.gyp: No Xcode or CLT version detected!gyp ERR! configure errorgyp ERR! stack Error: `gyp` failed with exit code: 1

2、查阅相关博客后有以下解决方案

终端输入:

xcode-select --install

3、但未能解决问题,控制台

终端报错:

xcode-select: error: command line tools are already installed, use "Software Update" to install updates

4、终端输入如下命令查看当前CLT(Command Line Tools)版本

brew config

5、最后找到解决办法:

直接去Apple 官网下载最新版本的Command Line Tools安装即可,然后再通过brew config查看当前CLI版本号是否变更
链接:https://developer.apple.com/download/more/


  • 2019-10-08 13:14:44

    MySQL 批量修改表名

    功能:将数据库 booksystem 中的表名前缀是 sys_ 开头的表名替换 sys_ 为 qun_

  • 2019-10-08 13:26:19

    详解Linux服务器最大tcp连接数

    1全部作为client端的情况下,最大tcp连接数为65535,这些连接可以连到不同的server ip。 2对server端,通过增加内存、修改最大文件描述符个数等参数,单机最大并发TCP连接数超过10万 是没问题的,国外 Urban Airship 公司在产品环境中已做到 50 万并发 。

  • 2019-10-08 14:09:57

    git创建分支并提交到远程分支

    远程分支的创建,一般都是基于本地分支的。即将本地的某个分支提交到远程,作为远程分支。命令如下: