【发布时间】:2021-07-14 00:59:09
【问题描述】:
我一直在使用 discord.js、visual studio code 和 node.js 编写一个机器人,并且我一直在尝试将它托管在 Heroku 上。但是,我的 Heroku 项目中的日志声称我的构建失败,当我查看失败的构建日志时,它给出了以下消息:
-----> Installing dependencies
Prebuild detected (node_modules already exists)
Rebuilding any native modules
> @discordjs/opus@0.5.0 install /tmp/build_0229f43f/node_modules/@discordjs/opus
> node-pre-gyp install --fallback-to-build
sh: 1: node-pre-gyp: Permission denied
npm ERR! code ELIFECYCLE
npm ERR! errno 126
npm ERR! @discordjs/opus@0.5.0 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 126
npm ERR!
npm ERR! Failed at the @discordjs/opus@0.5.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! /tmp/npmcache.q9Do7/_logs/2021-04-19T19_49_08_993Z-debug.log
-----> Build failed
此外,我对我的机器人所做的最新更改,例如为命令添加别名和更改我的宣布命令的 ping,在我从 Heroku 运行机器人时不适用,但在我运行时确实有效机器人本地,我认为构建失败可能是这背后的原因。我可能错了,但我对 Discord 机器人的编码还是比较陌生。如何修复构建失败?
【问题讨论】:
标签: node.js heroku visual-studio-code discord.js