【发布时间】:2018-01-22 05:39:14
【问题描述】:
我今天尝试将我的 discord 机器人上传到 heroku,但每次我使用 git push heroku master 时都会出现以下错误:
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> App not compatible with buildpack: https://codon-
buildpacks.s3.amazonaws.com/buildpacks/heroku/nodejs.tg
remote: More info:
https://devcenter.heroku.com/articles/buildpacks#detection-failure
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to sjak-bot.
remote:
To https://git.heroku.com/sjak-bot.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/sjak-bot.git'
我已经做了heroku buildpacks:set heroku/nodejs,将node.js和npm版本添加到package.json中,但仍然报同样的错误。
这个机器人是用javascript编写的
【问题讨论】:
-
你创建了 Procfile 了吗?
-
您的
package.json文件是否在存储库的根目录中? -
是的,我有一个 Procfile,这是其中的代码:
web: node index.js,是的,package.json 位于存储库的根目录中。 -
你成功了吗?我收到相同的消息,但在 heroku 文档或网络上的任何地方都找不到此错误。
-
我忘记创建
package.json,所以我输入了npm init并创建了一个,它已修复。
标签: javascript node.js git heroku discord