heroku为节点:!Heroku推送拒绝,没有检测到Cedar支持的应用程序

Dav*_*vid 11 javascript heroku node.js express

我是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'
Run Code Online (Sandbox Code Playgroud)

how*_*ghk 16

你是否在Heroku开发中心的Heroku文章中阅读了Node.js入门书

您需要使用Procfile声明您的流程类型.为此,请创建一个名为的文件Procfile,其中包含以下内容:

web: node web.js
Run Code Online (Sandbox Code Playgroud)

假设您的javascript文件被调用web.js.

ps不要忘记将Procfile添加到git并提交它.

  • 它可能是package.json,我设置为忽略git中的json文件.我强制git添加它,现在它工作,谢谢! (3认同)
  • 当他们谈论heroku文档上的文本文件时,我想补充说它叫做Procfile而不是Procfile.txt.@howanghk你说得对"创建一个名为Procfile的文件",在文档中他们只是说"使用Procfile,应用程序根目录中的文本文件,......".他们的文档很糟糕,我在哪里知道该文件名为Procfile.他们应该付钱给你的文件:) (3认同)

mpm*_*mpm 7

你需要一个package.json文件(和一个Procfile),很可能不是这样.