Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 节点的heroku:!Heroku推送被拒绝,未检测到支持Cedar的应用程序_Javascript_Node.js_Heroku_Express - Fatal编程技术网

Javascript 节点的heroku:!Heroku推送被拒绝,未检测到支持Cedar的应用程序

Javascript 节点的heroku:!Heroku推送被拒绝,未检测到支持Cedar的应用程序,javascript,node.js,heroku,express,Javascript,Node.js,Heroku,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. To

我不熟悉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'

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

您是否阅读了Heroku开发中心的文章

你需要这样做。为此,请创建一个名为
Procfile
的文件,其中包含以下内容:

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


p、 别忘了将Procfile添加到git并提交它。

为了记录在案,我遇到了同样的问题,结果它是Heroku中的一个配置变量。
我删除了配置变量并成功推送了应用程序

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

要解决此问题,请不要使用:

git push heroku master
我用过:

git push heroku my-branch:master

这将git存储库中的远程分支
我的分支
推送到heroku的
主分支。

对我来说,执行
npm init
就足够了

它可能是package.json,我设置忽略git中的json文件。我强迫git添加它,现在它工作了,谢谢!您可能还想从github检查这个文件。当他们谈到heroku文档上的文本文件时,我想补充一点,它被称为Procfile,而不是Procfile.txt@howanghk你说得对“创建一个名为Procfile的文件”,在文档中他们只说“使用一个Procfile,一个应用程序根目录中的文本文件,…”。他们的文件很烂,我从哪里知道这个文件叫Procfile。他们应该向您支付制作文档的费用:)