【问题标题】:heroku for node: ! Heroku push rejected, no Cedar-supported app detected节点的heroku:! Heroku 推送被拒绝,未检测到 Cedar 支持的应用程序
【发布时间】:2012-12-05 06:32:25
【问题描述】:

我是 heroku 和 express.js 的新手。我尝试完成本教程,但我无法通过步骤 'git push heroku master' 完成。我完全按照教程进行。以下是错误信息:

Counting objects: 269, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (241/241), done.
Writing objects: 100% (269/269), 188.93 KiB, done.
Total 269 (delta 9), reused 0 (delta 0)
 !     Heroku push rejected, no Cedar-supported app detected

To git@heroku.com:cryptic-journey-9914.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:cryptic-journey-9914.git'

【问题讨论】:

    标签: javascript node.js heroku express


    【解决方案1】:

    您是否阅读了关于 Heroku 开发中心的 Getting Started with Node.js on Heroku 文章?

    您需要declare your process type with Procfile。为此,请创建一个名为 Procfile 的文件,其内容如下:

    web: node web.js
    

    假设您的 javascript 文件名为 web.js

    附言不要忘记将 Procfile 添加到 git 并提交。

    【讨论】:

    • 可能是package.json,我设置为忽略git中的json文件。我强制 git 添加它,现在它可以工作了,谢谢!
    • 您可能还想查看来自 github 的 .gitignore 文件。
    • 当他们谈论 heroku 文档上的文本文件时,我想补充一点,它称为 Procfile 而不是 Procfile.txt。 @hohanghk你说得对“创建一个名为Procfile的文件”,在文档中他们只是说“使用Procfile,应用程序根目录中的文本文件,......”。他们的文档很烂,我从哪里知道该文件称为 Procfile。他们应该付钱给你制作他们的文件:)
    【解决方案2】:

    您需要一个 package.json 文件(和一个 Procfile),但可能并非如此。

    【讨论】:

      【解决方案3】:

      我之前也遇到过这个问题,这是因为我试图将远程分支推送到 heroku。

      解决问题,而不是使用:

      git push heroku master
      

      我用过:

      git push heroku my-branch:master
      

      这会将git存储库中的远程分支my-branch推送到heroku的master分支。

      【讨论】:

        【解决方案4】:

        为了记录,我遇到了同样的问题,结果证明是 Heroku 中的 Config Vars 之一。 我删除了配置变量,应用程序已成功推送。

        【讨论】:

          【解决方案5】:

          对我来说,npm init 就足够了

          【讨论】:

            猜你喜欢
            • 2012-01-11
            • 2014-11-09
            • 2015-07-18
            • 1970-01-01
            • 2012-03-07
            • 2014-01-22
            • 1970-01-01
            • 2013-08-23
            • 2013-11-28
            相关资源
            最近更新 更多