我已經「Google搜索」並在此處找到許多類似的答案。這是我的確切錯誤。NodeJS - 推送被拒絕,未檢測到雪松支持的應用程序
$ 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 [email protected]:vidperdiem.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to '[email protected]:vidperdiem.git'
是的,我的確遵循了Heroku的指南(其中NPM安裝說的),並驗證了我在Heroku回購是一個遠程
,這些都是我的文件
package.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"
}
}
Procfile
web: node app.js
app.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'));
});
快速猜測:確保'Procfile'和'package .json'確實被git跟蹤 –
@NitzanShaked我使用了Github的默認'.gitignore',所以這不是問題。問題是我在Github上創建了回購,然後在本地克隆,然後在該文件中,我創建了nodejs應用程序。所以我能夠推動改爲github作爲我的起源,但與heroku我不在根。所以我將這些文件複製出應用程序文件夾並將它們帶入主文件夾。我應該用學到的教訓刪除我的問題或答案嗎? – JGallardo
答案與經驗教訓。你甚至可以接受你自己的答案。這是在常見問題。路要走。 –