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/


  • 2021-02-19 16:46:35

    window安装composer

    Composer 是 PHP 的一个依赖管理工具。它允许你申明项目所依赖的代码库,它会在你的项目中为你安装他们。

  • 2021-02-21 22:52:12

    php去除字符串中的HTML标签

    php自带的函数可以去除/删除字符串中的HTML标签/代码。 strip_tags(string,allow):函数剥去 HTML、XML 以及 PHP 的标签。 参数:string,必填,规定要检查的字符串;allow,选填,规定允许存在的标签,这些标签不会被删除。

  • 2021-03-02 16:00:30

    git pull时的filename too long的错误

    这是因为git在windowa下的文件名长度最大是260,(git在Linux下最大支持4096长度的文件名),可以通过输入以下命令解决:

  • 2021-03-05 13:18:03

    mjml教程详解

    mjml如何快速编写响应式电子邮件

  • 2021-03-15 10:34:55

    Sass函数:Sass Maps的函数-map-get($map,$key)

    map-get($map,$key) 函数的作用是根据 $key 参数,返回 $key 在 $map 中对应的 value 值。如果 $key 不存在 $map中,将返回 null 值。此函数包括两个参数: