我已经“谷歌搜索”并在这里找到了许多类似的答案。这是我的确切错误。
$ git push heroku master
Counting objects: 43, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (35/35), done.
Writing objects: 100% (43/43), 5.19 KiB, done.
Total 43 (delta 10), reused 0 (delta 0)
! Push rejected, no Cedar-supported app detected
To git@heroku.com:vidperdiem.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:vidperdiem.git'
是的,我确实遵循了 Heroku 指南(对 NPM 安装说)并验证了我在 Heroku 上的存储库是远程的
这些是我的文件
包.json
{
"name": "vidperdiem",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node app.js"
},
"dependencies": {
"express": "3.4.4",
"jade": "*",
"stylus": "*"
},
"engines": {
"node": "0.8.x",
"npm": "1.2.x"
}
}
档案
web: node app.js
应用程序.js
/**
* Module dependencies.
*/
var express = require('express');
var routes = require('./routes');
var user = require('./routes/user');
var http = require('http');
var path = require('path');
var app = express();
// all environments
app.set('port', process.env.PORT || 3000);
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'jade');
app.use(express.favicon());
app.use(express.logger('dev'));
app.use(express.json());
app.use(express.urlencoded());
app.use(express.methodOverride());
app.use(app.router);
app.use(require('stylus').middleware(path.join(__dirname, 'public')));
app.use(express.static(path.join(__dirname, 'public')));
// development only
if ('development' == app.get('env')) {
app.use(express.errorHandler());
}
app.get('/', function(req, res){
res.render('index', {
title: 'Home'
});
});
app.get('/about', function(req, res){
res.render('about', {
title: 'About'
});
});
app.get('/contact', function(req, res){
res.render('contact', {
title: 'Contact'
});
});
app.get('/privacy', function(req, res){
res.render('privacy', {
title: 'Privacy'
});
});
app.get('/terms', function(req, res){
res.render('terms', {
title: 'Terms'
});
});
app.get('/users', user.list);
http.createServer(app).listen(app.get('port'), function(){
console.log('Express server listening on port ' + app.get('port'));
});