我尝试从Heroku运行我的Discord bot并且我一直收到一个错误,当我从命令提示符处运行脚本时我无法获得该错误。
2018-04-30T10:06:12.826804 + 00:00 app [worker.1]:at Object。 (/app/app.js:1:79)
2018-04-30T10:06:12.826801 + 00:00 app [worker.1]:在Module.require(module.js:596:17)
2018-04-30T10:06:12.826805 + 00:00 app [worker.1]:在Module._compile(module.js:652:30)
2018-04-30T10:06:12.826806 + 00:00 app [worker.1]:at Object.Module._extensions..js(module.js:663:10)
2018-04-30T10:06:12.826808 + 00:00 app [worker.1]:在Module.load(module.js:565:32)
2018-04-30T10:06:12.826809 + 00:00 app [worker.1]:at tryModuleLoad(module.js:505:12)
2018-04-30T10:06:12.826811 + 00:00 app [worker.1]:at Function.Module._load(module.js:497:3)
2018-04-30T10:06:12.900030 + 00:00 heroku [worker.1]:状态由崩溃变为
2018-04-30T10:06:28.454851 + 00:00 heroku [router]:at = error code = H14 desc =“没有网络进程正在运行”method = GET path =“/”host = vertigo-bot.herokuapp .com request_id = aaa10458-2921-457a-b3c2-57371244cbc8 fwd =“HIDDEN”dyno = connect = service = status = 503 bytes = protocol = https
2018-04-30T10:06:29.034606 + 00:00 heroku [router]:at = error code = H14 desc =“没有网络进程正在运行”method = GET path =“/ favicon.ico”host = vertigo- bot.herokuapp.com request_id = b881c0bc-8011-4487-9aaa-3c6865652044 fwd =“HIDDEN dyno = connect = service = status = 503 bytes = protocol = https
答案 0 :(得分:2)
你似乎没有任何"依赖"在你的package.json中。 因此,Heroku无法找到您的应用所依赖的discord.js。
要解决此问题,请运行:
npm install discord.js --save
然后提交你的package.json,并推送到heroku。
答案 1 :(得分:1)
在你的package.json中,你还没有安装discord.js。只需转到代码编辑器并将discord.js安装为已保存的依赖项即可。然后将package.json中的所有内容复制到GitHub。
希望这有帮助!