问题

最近在macOS Catalina中使用npm安装模块,经常会出现如下错误:


> node-gyp rebuild 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 error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack at ChildProcess.emit (events.js:210:5)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Darwin 19.3.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/yangjian/Documents/temp/test001/node_modules/fsevents
gyp ERR! node -v v12.13.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
  • 截图如下

解决方案

1. 尝试用如下命令进行修复

$ xcode-select --install

系统提示如下信息:

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

而事实上并没有所谓的"Software Update"可以更新

2. 正确姿势

一筹莫展之际,找到如下解决方案:

$ sudo rm -rf $(xcode-select -print-path)
$ xcode-select --install

请参见:

NPM Error:gyp: No Xcode or CLT version detected!的更多相关文章

  1. npm install 提示 `gyp: No Xcode or CLT version detected!` MacOS 10.15

    https://github.com/nodejs/node-gyp/issues/569 https://github.com/nodejs/node-gyp/issues/1927 解决链接:ht ...

  2. System Error:/usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.15' not found

    System Error:/usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.15' not found 1.运行程序是,系统报错库文件libstdc++. ...

  3. Mac下idea启动H5报错:xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Deve

    1. 执行“ xcodebuild -showsdks ”,报错如下“xcode-select: error: tool 'xcodebuild' requires Xcode, but active ...

  4. 使用bootstrap的dropdown部件时报错:error:Bootstrap dropdown require Popper.js

    前言:前端小白一枚,刚注册博客,先发个学习过程中新碰到小问题试试水吧~ 摘要:最近在学习bootstrap,偶然碰到了一个小问题,bootstrap网站也没有做过多的解释,今天分享给大家. 问题描述: ...

  5. ios 自动化构建 code-select: error: tool 'xcodebuild' requires Xcode, but active developer directory.....

    问题描述: Pod installation complete! There are 2 dependencies from the Podfile and 3 total pods installe ...

  6. 关于error:Cannot assign to 'self' outside of a method in the init family

    有时候我们重写父类的init方法时不注意将init后面的第一个字母写成了小写,在这个方法里面又调用父类的初始化方法(self = [super init];)时会报错,错误信息如下:error:Can ...

  7. Xcode - xcode-select: error: tool 'xcodebuild' requires Xcode报错解决方案

    用mac 自带的终端执行的命令,安装安装Vapor和toolbox 安装指令: macdeMacBook-Pro:~ mac$ curl -sL check.vapor.sh| bash 结果报这个错 ...

  8. stderr: xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

    错误提示: (1). stderr: xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer direc ...

  9. Mac Angular打包报错xcode-select: error: tool 'xcodebuild' requires Xcode

    Mac Angular打包报错: Error: xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer ...

随机推荐

  1. Java报错:Failed to execute goal org.eclipse.jetty:jetty-maven-plugin:9.4.26.v20200117:run (default-cli) on project ssm-mybatis-plus: Failure

    修改一下端口就好了,不要用80端口. <plugin> <groupId>org.eclipse.jetty</groupId> <!--嵌入式Jetty的M ...

  2. [ Shell ] 通过 Shell 脚本导出 GDSII/OASIS 文件

    https://www.cnblogs.com/yeungchie/ 常见的集成电路版图数据库文件格式有 GDSII 和 OASIS,virtuoso 提供了下面两个工具用来在 Shell 中导出版图 ...

  3. 企业需要使用网络损伤仪 WANsim 的帮助,以便更高效地迁移到云端

    正确解决与云环境中的应用程序部署有关的问题需要针对每个系统的独特需求以寻找特定的网络工具.网络损伤仪 WANsim 助力企业更高效地迁移到云端! 起初,云厂商以在云端办公相对于传统方式拥有更高的可靠性 ...

  4. Unity-动画状态机使用细节记录

    Unity动画控制器Animator功能非常强大,总结一些具体使用细节,在动作游戏中很实用: 1.动画烘焙 不同动画之间,可能存在角色朝向,重心高度不一致: 可以在动画Eidt界面设置RootTran ...

  5. 初识ES6(JavaScript)

    初识ES6(JavaScript) 关于ES6: ES6即ECMAScript6,是一种规范,JavaScript遵循了这种规范. *优点:*代码比较简洁. *缺点:*浏览器的兼容性不好. 1.变量和 ...

  6. C++篇:第四章_函数_知识点大全

    C++篇为本人学C++时所做笔记(特别是疑难杂点),全是硬货,虽然看着枯燥但会让你收益颇丰,可用作学习C++的一大利器 五.函数 (一)函数使用规则 函数的定义不能嵌套但调用可以嵌套 在函数调用时,如 ...

  7. Java核心知识1:泛型机制详解

    1 理解泛型的本质 JDK 1.5开始引入Java泛型(generics)这个特性,该特性提供了编译时类型安全检测机制,允许程序员在编译时检测到非法的类型. 泛型的本质是参数化类型,即给类型指定一个参 ...

  8. 百度AI人脸检测——解析JSON 数据格式

    1.了解一下 通常情况下,每个需要访问网络的应用程序都会有一个自己的服务器,我们可以向服务器提交数据,也可以从服务器上获取数据.不过这个时候就出现了一个问题,这些数据到底要以什么样的格式在网络上传输呢 ...

  9. Git删除已提交的文件

    Git删除已提交的文件 Git删除已提交的文件 定位文件 删除文件 参考链接 昨天通过Git Bash提交代码的时候遇到了由于单个文件大小超过100M,导致代码上传失败的问题.考虑到那个大文件是用于训 ...

  10. jmeter工具初探

    jmeter工具初探 一.jmeter工具介绍 1.一种免费的java开源工具,可以进行二次开发 2.运行环境:java运行环境,需要安装JDK,配置JAVAHOME 环境变量 3.下载jmeter: ...