2013-04-27 51 views
0

執行Procfile模塊我本地我的Windows 7計算機上,而不在0.8.18運行的任何問題我運行的應用程序的NodeJS。然而,當我把它推到的Heroku和嘗試訪問該網址,記錄了以下錯誤:應用的NodeJS在崩潰之前module.js Heroku上

2013-04-27T19:34:14.073833+00:00 heroku[web.1]: Process exited with status 1 
2013-04-27T19:34:59.340168+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=myapp.org fwd="108.212.64.90" dyno= connect= service= status=503 bytes= 
2013-04-27T19:35:00.565119+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=myapp.org fwd="108.212.64.90" dyno= connect= service= status=503 bytes= 
2013-04-27T19:44:23.916316+00:00 heroku[web.1]: Starting process with command `node myApp.js` 
2013-04-27T19:44:24.424716+00:00 app[web.1]: 
2013-04-27T19:44:24.425324+00:00 app[web.1]: /app/myApp.js:7 
2013-04-27T19:44:24.425680+00:00 app[web.1]: ; 
2013-04-27T19:44:24.425725+00:00 app[web.1]: ^
2013-04-27T19:44:24.429639+00:00 app[web.1]: SyntaxError: Unexpected token ; 
2013-04-27T19:44:24.429639+00:00 app[web.1]:  at Module._compile (module.js:437:25) 
2013-04-27T19:44:24.429639+00:00 app[web.1]:  at Object.Module._extensions..js (module.js:467:10) 
2013-04-27T19:44:24.429639+00:00 app[web.1]:  at Module.load (module.js:356:32) 
2013-04-27T19:44:24.429639+00:00 app[web.1]:  at Function.Module._load (module.js:312:12) 
2013-04-27T19:44:24.429639+00:00 app[web.1]:  at Module.runMain (module.js:492:10) 
2013-04-27T19:44:24.429639+00:00 app[web.1]:  at process.startup.processNextTick.process._tickCallback (node.js:245:9) 
2013-04-27T19:44:25.437926+00:00 heroku[web.1]: Process exited with status 1 
2013-04-27T19:44:25.414435+00:00 heroku[web.1]: State changed from starting to crashed 
2013-04-27T19:44:22.954367+00:00 heroku[web.1]: State changed from crashed to starting 

我procfile簡單地寫着:

web: node myApp.js 

package.json寫着:

{ 
    "name": "Arbol", 
    "version": "0.0.1", 
    "dependencies": { 
    "express": "3.1.0", 
"bcrypt": "0.7.5", 
"connect-flash": "0.1.0", 
"sequelize":"1.4.1", 
"ejs":"0.8.3", 
"oath":"0.2.3", 
"node-markdown":"0.1.1", 
"pg":"0.15.1", 
"passport":"0.1.16", 
"passport-twitter":"0.1.4", 
"passport-google":"0.3.0", 
"passport-facebook":"0.1.5" 
    }, 
    "engines": { 
    "node": "0.8.x", 
    "npm": "1.1.x" 
    } 
} 

另外,這裏是myApp.js第一行:

console.log('neither here'); 
var express = require('express'), 
app = module.exports = express(), 
passport = require('passport'), 
flash = require('connect-flash'), 
FacebookStrategy = require('passport-facebook').Strategy, 
TwitterStrategy = require('passport-twitter').Strategy, 
GoogleStrategy = require('passport-google').Strategy; 
console.log('nor there'); 

無論何時部署到Heroku上的console.log消息記錄。

似乎沒有什麼myApp.js引起此問題,而是它正在由Module引起的。什麼是Module.js?我在哪裏可以找到它,爲什麼我的應用程序會導致它的問題?

+0

不知道,如果它是區分大小寫的,但你的procfile讀取myapp.js,而你的文件名是對myApp。 js(大寫字母A)。 – drorw 2013-04-27 20:12:24

+0

那是我粗心的錯誤 - 我取代我真正Procfile模塊的名稱與'只是爲這個職位myApp.js'。 – 2013-04-27 20:14:29

+1

你可以發佈你的package.json嗎?你在本地和在Heroku上使用什麼節點版本? – drorw 2013-04-27 20:22:03

回答

1

我改變通過的package.json明確說明確切的節點版本和問題走了:

"engines": { 
    "node": "0.8.19", 
    "npm": "1.1.x" 
    }