npm 安装错误 - 未检测到 Xcode 或 CLT 版本? [英] npm install error - No Xcode or CLT version detected?
问题描述
在/"处找不到com.apple.pkg.cltools_executables"的收据"
"no receipt for 'com.apple.pkg.cltools_executables' found at '/'"
在 MacOS (Catalina) 的 VS Code bash 终端中为 angular 9 项目运行npm install"时抛出上述错误
Above error is thrown while running 'npm install' for an angular 9 project in VS Code bash terminal for MacOS (Catalina)
Package.json 依赖项:
Package.json dependencies:
"@angular/animations": "~9.1.1",
"@angular/common": "~9.1.1",
"@angular/compiler": "~9.1.1",
"@angular/core": "~9.1.1",
"@angular/platform-browser": "~9.1.1",
"@angular/platform-browser-dynamic": "~9.1.1",
"@angular/router": "~9.1.1",
"rxjs": "~6.5.4",
"tslib": "1.10.0",
"zone.js": "0.10.2"
推荐答案
我按照以下步骤操作:
找出命令行工具的路径
xcode-select --print-path
删除命令行工具目录(目录路径可从上述步骤中检索)sudo rm -rf/Library/Developer/CommandLineTools
Delete command line tools directory ( Directory path can be retrieved from the above step )
sudo rm -rf /Library/Developer/CommandLineTools
运行这个重新安装xcode-select --install
发布此信息,'npm install' 应该可以在 MacOS bash 终端的 VS Code 上成功运行.
Post this, 'npm install' should run successfully on VS Code in MacOS bash terminal.
这篇关于npm 安装错误 - 未检测到 Xcode 或 CLT 版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!