2015-10-27 38 views
1

我所試圖做的Heroku | Node.js的:沒有雪松支持的應用檢測

我試圖把這個簡單的應用的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')); 

[email protected] 9 test staff 306 27 Okt 20:41 . 
[email protected] 16 test staff 544 27 Okt 20:28 .. 
[email protected] 1 test staff 6148 22 Okt 08:57 .DS_Store 
[email protected] 11 test staff 374 27 Okt 20:28 .git 
[email protected] 1 test staff 18 27 Okt 16:05 Procfile 
[email protected] 1 test staff 196 27 Okt 15:46 index.js 
[email protected] 3 test staff 102 27 Okt 20:28 node_modules 
[email protected] 1 test staff 323 27 Okt 20:41 package.json 
[email protected] 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" 
} 

和Procfile有這樣的內容:

web: node index.js 

我的問題是什麼

當我運行git push heroku master我收到此錯誤信息:

! Push rejected, no Cedar-supported app detected remote: HINT: This occurs when Heroku cannot detect the buildpack remote: to use for this application automatically. remote: See https://devcenter.heroku.com/articles/buildpacks

我一直ressources能夠找到告訴我這個消息是由一個丟失的package.json文件引起的。但在我的情況下,該文件在那裏。

我在做什麼錯? TIA

+0

哎只是嘗試這樣做,我看不出有什麼問題,我創建了一個默認的快遞應用,放置在您的index.js(而不是app.js)並用你的代替package.json,推送到heroku和voilla,沒有錯誤https://morning-chamber-5036.herokuapp.com/唯一的事情是,我沒有Procfile ... vl稍後再嘗試 –

+0

它也適用於我 - 你確定你的package.json文件包含在Git中嗎? EG:確保它確實被提交併推送到Heroku,否則你會得到上述錯誤。 – rdegges

+0

謝謝你,aishwatsingh和rdegges。這確實是一個基本的初學者錯誤:沒有提交的文件。它正在工作。感謝您的時間。 – rabbitco

回答

0

推到Heroku的前執行以下步驟混帳有:

git init // create repository 
git add [files] // add all relevant files to the repository 
git commit // commit the new files 
相關問題