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/


  • 2020-11-05 23:20:29

    mac更新node版本

    initializer function 0x0 not in mapped image for /usr/local/bin/node,除了上面的问题 你或许还出现过 no such file or directory 这样的提示,总之更新完以后node直接不能用了。

  • 2020-11-07 16:31:02

    nginx配置X-Frame-Options允许多个域名iframe嵌套

    有时候我们需要允许多个url的来源,但是又不能全部开放,所以应该匹配第三种方法ALLOW-FROM url,那么多个url该如何配置呢,百度了所有网站都没有找到,那么这里写给大家,其实很简单: add_header X-Frame-Options 'ALLOW-FROM https://xxx.xxxxxx.com https://xxx2.xxxxxxx.com'; 就是使用空格隔开就好了!

  • 2020-11-08 08:31:51

    meteor在不同端口启动服务

    当没有任何参数时,run是默认行为,在幕后,它3000端口开启node.js服务器实例,同时开启监听3001端口的MongoDB服务

  • 2020-11-11 15:05:39

    nuxt如何在其它js文件中使用store

    在新建的js文件中想用store里面的数据,比如token想在封装的axios里面,请求头里面去使用,亦或者通过app的JS接口获取token并存储在store里面。我们都知道如何在vue中如何使用。