Heroku | Node.js:未检测到支持cedar的应用程序
我想做的事 我正在尝试将这个简单的应用程序推送到Heroku:Heroku | Node.js:未检测到支持cedar的应用程序,node.js,heroku,Node.js,Heroku,我想做的事 我正在尝试将这个简单的应用程序推送到Heroku: var express = require("express"); var app = express(); app.set('port', (process.env.PORT || 5000)); app.get ("/", function(req, res) { res.send('Hello World') }); app.listen(app.get('port')); git init // cr
var express = require("express");
var app = express();
app.set('port', (process.env.PORT || 5000));
app.get ("/", function(req, res) {
res.send('Hello World')
});
app.listen(app.get('port'));
git init // create repository
git add [files] // add all relevant files to the repository
git commit // commit the new files
从包含以下文件的git根目录:
drwxr-xr-x@ 9 test staff 306 27 Okt 20:41 .
drwx------@ 16 test staff 544 27 Okt 20:28 ..
-rw-r--r--@ 1 test staff 6148 22 Okt 08:57 .DS_Store
drwxr-xr-x@ 11 test staff 374 27 Okt 20:28 .git
-rw-r--r--@ 1 test staff 18 27 Okt 16:05 Procfile
-rw-r--r--@ 1 test staff 196 27 Okt 15:46 index.js
drwxr-xr-x@ 3 test staff 102 27 Okt 20:28 node_modules
-rw-r--r--@ 1 test staff 323 27 Okt 20:41 package.json
-rw-r--r--@ 1 test staff 323 27 Okt 20:31 package.json~
其中package.json包含以下内容:
{
"name": "podio_script",
"version": "1.0.0",
"description": "test",
"main": "index.js",
"scripts": {
"start": "node index.js"
},
"dependencies": {
"express": "4.13.3"
},
"engines": {
"node": "0.12.7"
},
"author": "James Dean",
"license": "MIT"
}
web: node index.js
Procfile包含以下内容:
{
"name": "podio_script",
"version": "1.0.0",
"description": "test",
"main": "index.js",
"scripts": {
"start": "node index.js"
},
"dependencies": {
"express": "4.13.3"
},
"engines": {
"node": "0.12.7"
},
"author": "James Dean",
"license": "MIT"
}
web: node index.js
我的问题是什么
当我运行git push heroku master时,我收到以下错误消息:
!!推送被拒绝,未检测到支持Cedar的应用远程:提示:
当Heroku无法检测到buildpack remote:to时会发生这种情况
自动用于此应用程序。遥控器:参见
我能够找到的资源告诉我,此消息是由丢失的package.json文件引起的。但就我而言,文件就在那里
我做错了什么?TIA在推送到Heroku之前,必须执行以下git步骤:
var express = require("express");
var app = express();
app.set('port', (process.env.PORT || 5000));
app.get ("/", function(req, res) {
res.send('Hello World')
});
app.listen(app.get('port'));
git init // create repository
git add [files] // add all relevant files to the repository
git commit // commit the new files
在推送到Heroku之前,必须执行以下git步骤:
var express = require("express");
var app = express();
app.set('port', (process.env.PORT || 5000));
app.get ("/", function(req, res) {
res.send('Hello World')
});
app.listen(app.get('port'));
git init // create repository
git add [files] // add all relevant files to the repository
git commit // commit the new files
嘿,刚刚尝试了这个,我没有发现任何问题,我创建了一个默认的express应用程序,放置了index.js(而不是app.js)并用你的替换了package.json,推送到heroku和voilla,没有错误,唯一的问题是,我没有Procfile。。。vl稍后再试试它也适用于我——你确定你的package.json文件包含在Git中吗?确保它确实被提交并推送到Heroku,否则你会得到上面的错误。谢谢你,aishwatsingh和rdegges。这确实是一个基本的初学者错误:没有提交的文件。它现在正在工作。谢谢你的时间。嘿,刚刚尝试了这个,我没有发现任何问题,我创建了一个默认的express应用程序,放置了你的index.js(而不是app.js)并用你的替换了package.json,推送到heroku和voilla,没有错误,唯一的问题是,我没有Procfile。。。vl稍后再试试它也适用于我——你确定你的package.json文件包含在Git中吗?确保它确实被提交并推送到Heroku,否则你会得到上面的错误。谢谢你,aishwatsingh和rdegges。这确实是一个基本的初学者错误:没有提交的文件。它现在正在工作。谢谢你抽出时间。