NPM Error:gyp: No Xcode or CLT version detected!
问题
最近在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!的更多相关文章
- 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 ...
- 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++. ...
- 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 ...
- 使用bootstrap的dropdown部件时报错:error:Bootstrap dropdown require Popper.js
前言:前端小白一枚,刚注册博客,先发个学习过程中新碰到小问题试试水吧~ 摘要:最近在学习bootstrap,偶然碰到了一个小问题,bootstrap网站也没有做过多的解释,今天分享给大家. 问题描述: ...
- 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 ...
- 关于error:Cannot assign to 'self' outside of a method in the init family
有时候我们重写父类的init方法时不注意将init后面的第一个字母写成了小写,在这个方法里面又调用父类的初始化方法(self = [super init];)时会报错,错误信息如下:error:Can ...
- Xcode - xcode-select: error: tool 'xcodebuild' requires Xcode报错解决方案
用mac 自带的终端执行的命令,安装安装Vapor和toolbox 安装指令: macdeMacBook-Pro:~ mac$ curl -sL check.vapor.sh| bash 结果报这个错 ...
- 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 ...
- Mac Angular打包报错xcode-select: error: tool 'xcodebuild' requires Xcode
Mac Angular打包报错: Error: xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer ...
随机推荐
- python---双链表的常用操作
class Node(object): """结点""" def __init__(self, data): self.data = dat ...
- 项目-MyBlog
项目 地址:https://gitee.com/zwtgit/my-blog 由Docker + SpringBoot2.0 + Mybatis + thymeleaf 等技术实现, 功能齐全.部署简 ...
- centos7源码安装mysql5.7.19
centos7源码包安装mysql5.7 5.7.20安装方法和5.7.19的一样. 1.安装前准备 清空环境.安装相应的软件包 1>关闭防火墙和SELinux 2>配置yum源(阿里云, ...
- docker中mysql导入sql文件
1.先将文件导入到容器 docker cp **.sql [容器名]:/root/ 2.进入容器 docker exec -ti [容器名/ID]/bin/bash 3.将文件导入数据库 mysql ...
- Water 2.5.9 发布,一站式服务治理平台
Water(水孕育万物...) Water 为项目开发.服务治理,提供一站式解决方案(可以理解为微服务架构支持套件).基于 Solon 框架开发,并支持完整的 Solon Cloud 规范:已在生产环 ...
- Go xmas2020 学习笔记 12、Structs, Struct tags & JSON
12-Structs, Struct tags & JSON. Struct. Struct Gotcha. Anonymous Struct Type. Make the zero valu ...
- android软件简约记账app开发day01-今日收支明细的界面绘制
android软件简约记账app开发day01-今日收支明细的界面绘制 导入素材 导入在阿里iconfront图标库下载的字体图标分为大小两种,分别导入到项目目录mipmap-hdpi和mipmap- ...
- who 的页面制作
1. html 结构 <!-- section: Who we are --> <section id="who"> <div class=" ...
- MySQL远程连接、用户授权
目录 MySQL远程连接 创建用户.授权 MySQL添加用户.删除用户.授权及撤销权限 MySQL可授予用户的执行权限 MySQL远程连接 远程连接 授权 常见权限表 相关库:mysql 相关表:us ...
- bellman-ford 单源最短路问题 图解
核心思想:松弛操作 对于边(u,v),用dist(u)和(u,v)的和尝试更新dist(v): dist(v) = min(dist(v) , dist(u)+l(u,v) 注:dist(i)为源 ...