无法安装 xcodebuild/discord.js
Posted
技术标签:
【中文标题】无法安装 xcodebuild/discord.js【英文标题】:Failure to install xcodebuild/discord.js 【发布时间】:2021-02-06 00:02:22 【问题描述】:我正在制作一个不和谐的机器人。在终端中,在我执行 npm install --discord.js 之后,它会显示以下内容:
integer@2.1.0 install /Users/jasmine/Desktop/kookie/node_modules/integer
> 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:314:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Darwin 19.5.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/jasmine/Desktop/kookie/node_modules/integer
gyp ERR! node -v v12.19.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm WARN kookie@1.0.0 No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! integer@2.1.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the integer@2.1.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/jasmine/.npm/_logs/2020-10-22T22_03_21_562Z-debug.log
我尝试运行节点下载应用程序,但无法安装。如果我运行 node.js,会出现以下内容:
internal/modules/cjs/loader.js:834
throw err;
^
Error: Cannot find module 'quick.db'
Require stack:
- /Users/jasmine/Desktop/kookie/index.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:831:15)
at Function.Module._load (internal/modules/cjs/loader.js:687:27)
at Module.require (internal/modules/cjs/loader.js:903:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/Users/jasmine/Desktop/kookie/index.js:15:12)
at Module._compile (internal/modules/cjs/loader.js:1015:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1035:10)
at Module.load (internal/modules/cjs/loader.js:879:32)
at Function.Module._load (internal/modules/cjs/loader.js:724:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
code: 'MODULE_NOT_FOUND',
requireStack: [ '/Users/jasmine/Desktop/kookie/index.js' ]
【问题讨论】:
【参考方案1】:对于最重要的错误,这个修复对我有用:
sudo rm -rf $(xcode-select -print-path)
xcode-select --install
对于底部的,您似乎缺少 quick.db npm 包。 这应该足够了:
npm i quick.db
【讨论】:
【参考方案2】:安装 xcode 选择
xcode-select --install
然后
底部错误可以解决
npm install quick.db
【讨论】:
以上是关于无法安装 xcodebuild/discord.js的主要内容,如果未能解决你的问题,请参考以下文章
Chrome浏览器无法打开,安装程序也无法启动不能重新安装,啥原因?