2016-09-02 2 views
0

메신저 일종의 평균 스택을 배우고, 그 주위를 돌리는 모든, 난 약간 각도가 전에 expirience 있었고, 물론 나는 뭔가 abouyt 자바 스크립트와 웹 개발을 알아. 난이 오류가 내하지만 왜 Heroku가 메신저 좀 혼란 새로운 메신저 :헤로 쿠 응용 프로그램 오류 heroku 열려

Application Error An error occurred in the application and your page could not be served. Please try again in a few moments. If you are the application owner, check your logs for details.

내가 한 책에 설명 된 단계 : 나는 일부 폴더를 생성하는 표현을 사용

getting MEAN with Mongo, express, angular and node

Here is my log from heroku that shows the errors but i cant understand very well what they mean, sorry guys but im really a newbie :/ 

> 2016-09-02T12:00:37.889792+00:00 heroku[router]: at=error code=H10 desc="App cra 
shed" method=GET path="/favicon.ico" host=shrouded-garden-88708.herokuapp.com re 
quest_id=ef9cea17-fd9e-401e-b7e4-1cf7bf5d2ea2 fwd="2.83.58.24" dyno= connect= se 
rvice= status=503 bytes= 
2016-09-02T12:00:56.881479+00:00 heroku[api]: Starting process with command `rak 
e db:migrate` by [email protected] 
2016-09-02T12:00:59.200820+00:00 heroku[run.2019]: Awaiting client 
2016-09-02T12:00:59.233918+00:00 heroku[run.2019]: Starting process with command 
`rake db:migrate` 
2016-09-02T12:00:59.516923+00:00 heroku[run.2019]: State changed from starting t 
o up 
2016-09-02T12:01:01.250705+00:00 heroku[run.2019]: Process exited with status 12 
7 
2016-09-02T12:01:01.270229+00:00 heroku[run.2019]: State changed from up to comp 
lete 
2016-09-02T12:01:15.503673+00:00 heroku[web.1]: State changed from crashed to st 
arting 
2016-09-02T12:01:17.194538+00:00 heroku[web.1]: Starting process with command `n 
pm start` 
2016-09-02T12:01:19.940778+00:00 app[web.1]: 
2016-09-02T12:01:19.940796+00:00 app[web.1]: > [email protected] start /app 
2016-09-02T12:01:19.940797+00:00 app[web.1]: > node ./bin/www 
2016-09-02T12:01:19.940798+00:00 app[web.1]: 
2016-09-02T12:01:20.279763+00:00 app[web.1]: module.js:327 
2016-09-02T12:01:20.279777+00:00 app[web.1]: ^
2016-09-02T12:01:20.279776+00:00 app[web.1]:  throw err; 
2016-09-02T12:01:20.279778+00:00 app[web.1]: 
2016-09-02T12:01:20.279779+00:00 app[web.1]: Error: Cannot find module '../contr 
ollers/main' 
2016-09-02T12:01:20.279779+00:00 app[web.1]:  at Function.Module._resolveFile 
name (module.js:325:15) 
2016-09-02T12:01:20.279780+00:00 app[web.1]:  at Module.require (module.js:35 
3:17) 
2016-09-02T12:01:20.279780+00:00 app[web.1]:  at Function.Module._load (modul 
e.js:276:25) 
2016-09-02T12:01:20.279781+00:00 app[web.1]:  at require (internal/module.js: 
12:17) 
2016-09-02T12:01:20.279782+00:00 app[web.1]:  at Object.<anonymous> (/app/app 
_server/routes/index.js:3:16) 
2016-09-02T12:01:20.279782+00:00 app[web.1]:  at Module._compile (module.js:4 
09:26) 
2016-09-02T12:01:20.279783+00:00 app[web.1]:  at Object.Module._extensions..j 
s (module.js:416:10) 
2016-09-02T12:01:20.279784+00:00 app[web.1]:  at Module.load (module.js:343:3 
2) 
2016-09-02T12:01:20.279784+00:00 app[web.1]:  at Function.Module._load (modul 
e.js:300:12) 
2016-09-02T12:01:20.279785+00:00 app[web.1]:  at Module.require (module.js:35 
3:17) 
2016-09-02T12:01:20.291267+00:00 app[web.1]: 
2016-09-02T12:01:20.313237+00:00 app[web.1]: npm ERR! Linux 3.13.0-93-generic 
2016-09-02T12:01:20.313779+00:00 app[web.1]: npm ERR! argv "/app/.heroku/node/bi 
n/node" "/app/.heroku/node/bin/npm" "start" 
2016-09-02T12:01:20.314106+00:00 app[web.1]: npm ERR! node v4.5.0 
2016-09-02T12:01:20.315029+00:00 app[web.1]: npm ERR! npm v2.15.10 
2016-09-02T12:01:20.315379+00:00 app[web.1]: npm ERR! code ELIFECYCLE 
2016-09-02T12:01:20.315665+00:00 app[web.1]: npm ERR! [email protected] start: `node . 
/bin/www` 
2016-09-02T12:01:20.315908+00:00 app[web.1]: npm ERR! Exit status 1 
2016-09-02T12:01:20.316190+00:00 app[web.1]: npm ERR! 
2016-09-02T12:01:20.316464+00:00 app[web.1]: npm ERR! Failed at the [email protected] 
start script 'node ./bin/www'. 
2016-09-02T12:01:20.316739+00:00 app[web.1]: npm ERR! This is most likely a prob 
lem with the loc8r package, 
2016-09-02T12:01:20.316995+00:00 app[web.1]: npm ERR! not with npm itself. 
2016-09-02T12:01:20.317261+00:00 app[web.1]: npm ERR! Tell the author that this 
fails on your system: 
2016-09-02T12:01:20.317521+00:00 app[web.1]: npm ERR!  node ./bin/www 
2016-09-02T12:01:20.317784+00:00 app[web.1]: npm ERR! You can get information on 
how to open an issue for this project with: 
2016-09-02T12:01:20.318051+00:00 app[web.1]: npm ERR!  npm bugs loc8r 
2016-09-02T12:01:20.318319+00:00 app[web.1]: npm ERR! Or if that isn't available 
, you can get their info via: 
2016-09-02T12:01:20.318849+00:00 app[web.1]: npm ERR!  npm owner ls loc8r 
2016-09-02T12:01:20.318577+00:00 app[web.1]: npm ERR! 
2016-09-02T12:01:20.319132+00:00 app[web.1]: npm ERR! There is likely additional 
logging output above. 
2016-09-02T12:01:20.324563+00:00 app[web.1]: 
2016-09-02T12:01:20.324958+00:00 app[web.1]: npm ERR! Please include the followi 
ng file with any support request: 
2016-09-02T12:01:20.325214+00:00 app[web.1]: npm ERR!  /app/npm-debug.log 
2016-09-02T12:01:20.411685+00:00 heroku[web.1]: State changed from starting to c 
rashed 
2016-09-02T12:01:20.421165+00:00 heroku[web.1]: Process exited with status 1 
2016-09-02T12:01:24.051194+00:00 heroku[router]: at=error code=H10 desc="App cra 
shed" method=GET path="/" host=shrouded-garden-88708.herokuapp.com request_id=57 
100cae-5160-4d51-896a-c6098499d847 fwd="2.83.58.24" dyno= connect= service= stat 
us=503 bytes= 
2016-09-02T12:01:24.219376+00:00 heroku[router]: at=error code=H10 desc="App cra 
shed" method=GET path="/favicon.ico" host=shrouded-garden-88708.herokuapp.com re 
quest_id=f2bdbe3f-dac9-4831-bba4-4c81e533862a fwd="2.83.58.24" dyno= connect= se 
rvice= status=503 bytes= 
2016-09-02T12:10:23.795631+00:00 heroku[web.1]: State changed from crashed to st 
arting 
2016-09-02T12:10:25.543039+00:00 heroku[web.1]: Starting process with command `n 
pm start` 
2016-09-02T12:10:28.058117+00:00 app[web.1]: > [email protected] start /app 
2016-09-02T12:10:28.058105+00:00 app[web.1]: 
2016-09-02T12:10:28.058118+00:00 app[web.1]: > node ./bin/www 
2016-09-02T12:10:28.058119+00:00 app[web.1]: 
2016-09-02T12:10:28.258887+00:00 app[web.1]: module.js:327 
2016-09-02T12:10:28.258889+00:00 app[web.1]:  throw err; 
2016-09-02T12:10:28.258890+00:00 app[web.1]: ^
2016-09-02T12:10:28.258890+00:00 app[web.1]: 
2016-09-02T12:10:28.258892+00:00 app[web.1]:  at Function.Module._resolveFile 
name (module.js:325:15) 
2016-09-02T12:10:28.258891+00:00 app[web.1]: Error: Cannot find module '../contr 
ollers/main' 
2016-09-02T12:10:28.258893+00:00 app[web.1]:  at Function.Module._load (modul 
e.js:276:25) 
2016-09-02T12:10:28.258893+00:00 app[web.1]:  at Module.require (module.js:35 
3:17) 
2016-09-02T12:10:28.258894+00:00 app[web.1]:  at require (internal/module.js: 
12:17) 
2016-09-02T12:10:28.258895+00:00 app[web.1]:  at Object.<anonymous> (/app/app 
_server/routes/index.js:3:16) 
2016-09-02T12:10:28.258895+00:00 app[web.1]:  at Module._compile (module.js:4 
09:26) 
2016-09-02T12:10:28.258897+00:00 app[web.1]:  at Module.load (module.js:343:3 
2) 
2016-09-02T12:10:28.258896+00:00 app[web.1]:  at Object.Module._extensions..j 
s (module.js:416:10) 
2016-09-02T12:10:28.258897+00:00 app[web.1]:  at Function.Module._load (modul 
e.js:300:12) 
2016-09-02T12:10:28.268520+00:00 app[web.1]: 
2016-09-02T12:10:28.258898+00:00 app[web.1]:  at Module.require (module.js:35 
3:17) 
2016-09-02T12:10:28.276252+00:00 app[web.1]: npm ERR! Linux 3.13.0-93-generic 
2016-09-02T12:10:28.276653+00:00 app[web.1]: npm ERR! argv "/app/.heroku/node/bi 
n/node" "/app/.heroku/node/bin/npm" "start" 
2016-09-02T12:10:28.276901+00:00 app[web.1]: npm ERR! node v4.5.0 
2016-09-02T12:10:28.277388+00:00 app[web.1]: npm ERR! npm v2.15.10 
2016-09-02T12:10:28.277852+00:00 app[web.1]: npm ERR! code ELIFECYCLE 
2016-09-02T12:10:28.278329+00:00 app[web.1]: npm ERR! Exit status 1 
2016-09-02T12:10:28.278146+00:00 app[web.1]: npm ERR! [email protected] start: `node . 
/bin/www` 
2016-09-02T12:10:28.278515+00:00 app[web.1]: npm ERR! 
2016-09-02T12:10:28.278639+00:00 app[web.1]: npm ERR! Failed at the [email protected] 
start script 'node ./bin/www'. 
2016-09-02T12:10:28.278800+00:00 app[web.1]: npm ERR! This is most likely a prob 
lem with the loc8r package, 
2016-09-02T12:10:28.278919+00:00 app[web.1]: npm ERR! not with npm itself. 
2016-09-02T12:10:28.279166+00:00 app[web.1]: npm ERR!  node ./bin/www 
2016-09-02T12:10:28.279020+00:00 app[web.1]: npm ERR! Tell the author that this 
fails on your system: 
2016-09-02T12:10:28.279292+00:00 app[web.1]: npm ERR! You can get information on 
how to open an issue for this project with: 
2016-09-02T12:10:28.279425+00:00 app[web.1]: npm ERR!  npm bugs loc8r 
2016-09-02T12:10:28.279530+00:00 app[web.1]: npm ERR! Or if that isn't available 
, you can get their info via: 
2016-09-02T12:10:28.279709+00:00 app[web.1]: npm ERR! 
2016-09-02T12:10:28.279877+00:00 app[web.1]: npm ERR!  npm owner ls loc8r 
2016-09-02T12:10:28.280024+00:00 app[web.1]: npm ERR! There is likely additional 
logging output above. 
2016-09-02T12:10:28.283884+00:00 app[web.1]: 
2016-09-02T12:10:28.284074+00:00 app[web.1]: npm ERR! Please include the followi 
ng file with any support request: 
2016-09-02T12:10:28.284227+00:00 app[web.1]: npm ERR!  /app/npm-debug.log 
2016-09-02T12:10:28.405796+00:00 heroku[web.1]: State changed from starting to c 
rashed 
2016-09-02T12:10:28.367669+00:00 heroku[web.1]: Process exited with status 1 

APP_SERVER 제어기 Main.js

,691,363 : MVC의 패턴을 사용하여 코드를 변경, 여기서 코드210
module.exports.index = function(req, res){ 
res.render('index', { title: 'Express' }); 
}; 

경로하는 index.js

var express = require('express'); 
var router = express.Router(); 
var ctrlMain = require('../controllers/main'); 

router.get('/',ctrlMain.index); 

module.exports = router; 

doctype html 
html 
    head 
    meta(name='viewport', content='width=device-width, initial-scale=1.0') 
    title= title 
    link(rel='stylesheet', href='/bootstrap-3.3.7-dist/bootstrap-3.3.7-dist/css/amelia.bootstrap.css') 
    link(rel='stylesheet', href='/stylesheets/style.css') 
    body 
    block content 
    script(src='/javascripts/jquery-3.1.0.min.js') 
    script(src='/bootstrap-3.3.7-dist/bootstrap-3.3.7-dist/js/bootstrap.min.js') 

extends layout 

block content 
    h1= title 
    p Welcome to #{title} 
,536,913,632을 index.jade layout.jade

내 나쁜 영어에 대한 죄송합니다 : 10

app.js 여기

내가는 김 라우팅 그는 MVC 패턴

var express = require('express'); 
var path = require('path'); 
var favicon = require('serve-favicon'); 
var logger = require('morgan'); 
var cookieParser = require('cookie-parser'); 
var bodyParser = require('body-parser'); 

var routes = require('./app_server/routes/index'); 
var users = require('./app_server/routes/users'); 

var app = express(); 

// view engine setup 
app.set('views', path.join(__dirname,'app_server','views')); 
app.set('view engine', 'jade'); 

// uncomment after placing your favicon in /public 
//app.use(favicon(path.join(__dirname, 'public', 'favicon.ico'))); 
app.use(logger('dev')); 
app.use(bodyParser.json()); 
app.use(bodyParser.urlencoded({ extended: false })); 
app.use(cookieParser()); 
app.use(express.static(path.join(__dirname, 'public'))); 

app.use('/', routes); 
app.use('/users', users); 

// catch 404 and forward to error handlerr 
app.use(function(req, res, next) { 
    var err = new Error('Not Found'); 
    err.status = 404; 
    next(err); 
}); 

// error handlers 

// development error handler 
// will print stacktrace 
if (app.get('env') === 'development') { 
    app.use(function(err, req, res, next) { 
    res.status(err.status || 500); 
    res.render('error', { 
     message: err.message, 
     error: err 
    }); 
    }); 
} 

// production error handler 
// no stacktraces leaked to user 
app.use(function(err, req, res, next) { 
    res.status(err.status || 500); 
    res.render('error', { 
    message: err.message, 
    error: {} 
    }); 
}); 

module.exports = app; 

패키지 JSON

{ 


"name": "loc8r", 
    "version": "0.0.0", 
    "private": true, 
    "scripts": { 
    "start": "node ./bin/www" 
    }, 
    "engines": { 
    "node": "~4.5.0", 
    "npm": "~2.15.9" 
    }, 
    "dependencies": { 
    "body-parser": "~1.15.1", 
    "cookie-parser": "~1.4.3", 
    "debug": "~2.2.0", 
    "express": "~4.13.4", 
    "jade": "~1.11.0", 
    "morgan": "~1.7.0", 
    "serve-favicon": "~2.3.0" 
    } 
} 

시 사용할 수 변경

+0

문제는 heroku가 코드에 있으므로 우리가 문제를 추적 할 수 있도록 추가하십시오. – ramon22

+0

hmmm, 문제없이 코드를 로컬로 실행할 수 있습니다. 코드가 있어야 실행할 수 있습니다. 그렇지 않으면 잘못 되었습니까? –

답변

0

지금까지 버그가있을 수있는 곳은 없었습니다. package.json에 추가 했습니까? 섹션 :

"engines": { 
"node": ">=0.10.28", 
"npm": ">=1.4.28" 
} 

도 Main.js에 모듈없이 수출을 설정해보십시오 : 다음

var ctrlMain = require('../controllers/main'); 
exports.setIndexRoutes = function (app) { 
    app.route('/').get(ctrlMain.index); 
}; 

: 당신의 경로에서

exports.index = function(req, res){ 
    res.render('index', { title: 'Express' }); 
}; 

하는 응용 프로그램 인스턴스를 전달하려고은 다음과 같이 당신의 경로를 설정 app.js에서 app.use ('/'경로)를 다음과 같이 설정합니다.

var routes = require('./app_server/routes/index'); 
routes.setIndexRoutes(app); 
+0

패키지가 json 어쩌면 prob가 업데이트 되었습니까? –

관련 문제