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-12-03 15:50:00

    html5 audio stop功能

    html5并没有提供停止功能,我们需要通过其他方式来实现这个问题,下面我们来看下神仙般的操作。

  • 2019-12-03 16:33:49

    hapi,nuxtjs跨域请求

    简单请求 与 预检请求,Fetch 与 CORS 的一个有趣的特性是,可以基于 HTTP cookies 和 HTTP 认证信息发送身份凭证。一般而言,对于跨域 XMLHttpRequest 或 Fetch 请求,浏览器不会发送身份凭证信息。如果要发送凭证信息,需要设置 XMLHttpRequest 的某个特殊标志位。

  • 2019-12-03 16:36:03

    跨域资源共享 CORS 详解

    阮一峰大哥的文章写的不错,推荐,也推荐他的整个王章,大家可以去看一下啊。

  • 2019-12-03 16:37:01

    去除options,减少options的访问

    因为跨域请求,浏览器可能(后面讲)会发送一次options请求,如果处理不好,跨域还是会gg的。 之前很少涉及跨域,涉及也是简单请求(下面阮老师文章中区别热简单请求和复杂请求),所以基本不会很少关注options。后面就遇到坑了,下面讲讲注意点。