简体   繁体   English

heroku部署失败“应用程序错误”

[英]heroku deployment fails “Application error”

error message on the page 页面上的错误消息

An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details.   

I have saw several questions like mine, 我看到了几个问题,例如我的

Heroku + node.js error (Web process failed to bind to $PORT within 60 seconds of launch) Heroku + node.js错误(Web进程在启动后60秒内未能绑定到$ PORT)

Heroku code=H10 desc="App crashed" - Can't figure out why it's crashing Heroku代码= H10 desc =“应用程序崩溃”-无法弄清为什么崩溃

but I don't think I made the same mistake. 但我不认为我犯了同样的错误。

const express = require('express');
const app = express();
const wetalk = require('./app');
const passport = require('passport');

app.set('port', process.env.PORT || 3000);
app.use(express.static('public'));
app.set('view engine', 'ejs');

app.use(wetalk.session);

app.use(passport.initialize());
app.use(passport.session());

app.use(require('morgan')('combined', {
    stream: {
        write: message => {
            //write to logs 
            wetalk.logger.log('info', message);
        }
    }
}));
//router
app.use('/', wetalk.router);


wetalk.ioServer(app).listen(app.get('port'), () => {
    console.log('Wetalk running on the port', app.get('port'));
});

Here below is my console on git push heroku master 这是我在git push heroku master上的控制台

 Counting objects: 3, done.
    Delta compression using up to 8 threads.
    Compressing objects: 100% (3/3), done.
    Writing objects: 100% (3/3), 309 bytes | 0 bytes/s, done.
    Total 3 (delta 2), reused 0 (delta 0)
    remote: Compressing source files... done.
    remote: Building source:
    remote:
    remote: -----> Node.js app detected
    remote:
    remote: -----> Creating runtime environment
    remote:
    remote:        NPM_CONFIG_LOGLEVEL=error
    remote:        NPM_CONFIG_PRODUCTION=true
    remote:        NODE_VERBOSE=false
    remote:        NODE_ENV=production
    remote:        NODE_MODULES_CACHE=true
    remote:
    remote: -----> Installing binaries
    remote:        engines.node (package.json):  4.2.2
    remote:        engines.npm (package.json):   unspecified (use default)
    remote:
    remote:        Downloading and installing node 4.2.2...
    remote:        Using default npm version: 2.14.7
    remote:
    remote: -----> Restoring cache
    remote:        Loading 2 from cacheDirectories (default):
    remote:        - node_modules
    remote:        - bower_components (not cached - skipping)
    remote:
    remote: -----> Building dependencies
    remote:        Installing node modules (package.json)
    remote:
    remote: -----> Caching build
    remote:        Clearing previous node cache
    remote:        Saving 2 cacheDirectories (default):
    remote:        - node_modules
    remote:        - bower_components (nothing to cache)
    remote:
    remote: -----> Build succeeded!
    remote: -----> Discovering process types
    remote:        Procfile declares types     -> (none)
    remote:        Default types for buildpack -> web
    remote:
    remote: -----> Compressing...
    remote:        Done: 15.5M
    remote: -----> Launching...
    remote:        Released v14
    remote:        https://we-talk-cds.herokuapp.com/ deployed to Heroku
    remote:
    remote: Verifying deploy... done.
    To https://git.heroku.com/we-talk-cds.git
       d9bfd0f..a10aa13  master -> master

this is what show on the console, seems correct any help is appreciated 这是在控制台上显示的内容,看来是正确的,我们不胜感激

Check your logs. 检查您的日志。 You're using Papertrail. 您正在使用Papertrail。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM