FAQ
Hello I am trying to host my very simple test site (attached zip) on my
newly created Heroku account.

In the node.js console I do the usual *npm install* and *node app.js* and
it runs fine locally.

Then in my Git console:
*git init*
*git add .*
*git commit -m "initial commit"*
*heroku create --stack cedar*
*git push heroku master*
**
The output suggests everything went ok:
*Warning: Permanently added the RSA host key for IP address '50.19.85.132'
to the
list of known hosts.
Counting objects: 28, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (22/22), done.
Writing objects: 100% (28/28), 37.36 KiB, done.
Total 28 (delta 3), reused 0 (delta 0)*
*-----> Heroku receiving push
-----> Node.js app detected
-----> Resolving engine versions*
* WARNING: No version of Node.js specified in package.json, see:
**https://devcenter.heroku.com/articles/nodejs-versions*<https://devcenter.heroku.com/articles/nodejs-versions>
* WARNING: The default version of Node.js and npm on Heroku will begin
tracking the latest stable release starting September 1, 2012.*
* Using Node.js version: 0.4.7
Using npm version: 1.0.106
-----> Fetching Node.js binaries
-----> Vendoring node into slug
-----> Installing dependencies with npm
**jade@0.27.7* <jade@0.27.7>* ./node_modules/jade
â"oâ"?â"? **commander@0.6.1* <commander@0.6.1>
* â"oâ"?â"? **mkdirp@0.3.4* <mkdirp@0.3.4>
* â""â"?â"? **coffee-script@1.4.0* <coffee-script@1.4.0>
* **express@2.5.4* <express@2.5.4>* ./node_modules/express
â"oâ"?â"? **mkdirp@0.0.7* <mkdirp@0.0.7>
* â"oâ"?â"? **mime@1.2.7* <mime@1.2.7>
* â"oâ"?â"? **qs@0.5.2* <qs@0.5.2>
* â""â"?â"? **connect@1.9.2* <connect@1.9.2>
* **express@2.5.4* <express@2.5.4>*/tmp/build_uiq4xu423brt/node_modules/express
**connect@1.9.2* <connect@1.9.2>*/tmp/build_uiq4xu423brt/node_modules/express/node_modules/c
onnect
**qs@0.5.2* <qs@0.5.2>*/tmp/build_uiq4xu423brt/node_modules/express/node_modules/qs
**mime@1.2.7* <mime@1.2.7>*/tmp/build_uiq4xu423brt/node_modules/express/node_modules/mime
*
* **formidable@1.0.11* <formidable@1.0.11>*/tmp/build_uiq4xu423brt/node_modules/express/node_modul
es/connect/node_modules/formidable
**mkdirp@0.0.7* <mkdirp@0.0.7>*/tmp/build_uiq4xu423brt/node_modules/express/node_modules/mk
dirp
**jade@0.27.7* <jade@0.27.7>*/tmp/build_uiq4xu423brt/node_modules/jade
**commander@0.6.1* <commander@0.6.1>*/tmp/build_uiq4xu423brt/node_modules/jade/node_modules/co
mmander
**mkdirp@0.3.4* <mkdirp@0.3.4>*/tmp/build_uiq4xu423brt/node_modules/jade/node_modules/mkdir
p
**coffee-script@1.4.0* <coffee-script@1.4.0>*/tmp/build_uiq4xu423brt/node_modules/jade/node_module
s/coffee-script
Dependencies installed
-----> Building runtime environment
-----> Discovering process types
Procfile declares types -> web
-----> Compiled slug size: 3.8MB
-----> Launching... done, v4
**http://peaceful-sea-1065.herokuapp.com*<http://peaceful-sea-1065.herokuapp.com/>
* deployed to Heroku*
*To **git@heroku.com:peaceful-sea-1065.git*<git@heroku.com:peaceful-sea-1065.git>
* * [new branch] master -> master*
**
However when I browse to the site: *http://peaceful-sea-1065.herokuapp.com*<http://peaceful-sea-1065.herokuapp.com/>
* *I get:

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.

Is there anything obvious I have got wrong here?

Thanks, Dave J.




--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Search Discussions

  • Dave Johnson at Dec 3, 2012 at 8:13 pm
    It's to do with the variable *Port* it is null when it uploaded to the
    server:
    /**
    * Module dependencies.
    */
    var express = require('express');
    var routes = require('./routes');
    var port = process.env.PORT || 3000;
    var app = module.exports = express.createServer();
    // Configuration
    app.configure(function(){
    app.set('views', __dirname + '/views');
    app.set('view engine', 'jade');
    app.use(express.bodyParser());
    app.use(express.methodOverride());
    app.use(app.router);
    app.use(express.static(__dirname + '/public'));
    });
    app.configure('development', function(){
    app.use(express.errorHandler({ dumpExceptions: true, showStack: true }));
    });
    app.configure('production', function(){
    app.use(express.errorHandler());
    });
    // Routes
    app.get('/', routes.index);
    app.get('/about', routes.about);
    app.get('/contact', routes.contact);
    app.listen(port);
    console.log("Express server listening on port %d in %s mode",
    app.address().port, app.settings.env);



    error: TypeError: Cannot read property 'port' of null



    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
  • Michal Kruk at Dec 3, 2012 at 8:15 pm
    I suppose you don want to use node 0.4.7 currently heroku by default uses
    this version if you dont specify it otherwise, try including this info in
    your package.json

    https://devcenter.heroku.com/articles/nodejs-versions

    Regards Michał Kruk
    On Mon, Dec 3, 2012 at 9:05 PM, Dave Johnson wrote:

    It's to do with the variable *Port* it is null when it uploaded to the
    server:
    /**
    * Module dependencies.
    */
    var express = require('express');
    var routes = require('./routes');
    var port = process.env.PORT || 3000;
    var app = module.exports = express.createServer();
    // Configuration
    app.configure(function(){
    app.set('views', __dirname + '/views');
    app.set('view engine', 'jade');
    app.use(express.bodyParser());
    app.use(express.methodOverride());
    app.use(app.router);
    app.use(express.static(__dirname + '/public'));
    });
    app.configure('development', function(){
    app.use(express.errorHandler({ dumpExceptions: true, showStack: true
    }));
    });
    app.configure('production', function(){
    app.use(express.errorHandler());
    });
    // Routes
    app.get('/', routes.index);
    app.get('/about', routes.about);
    app.get('/contact', routes.contact);
    app.listen(port);
    console.log("Express server listening on port %d in %s mode",
    app.address().port, app.settings.env);



    error: TypeError: Cannot read property 'port' of null



    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines:
    https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
  • Dave Johnson at Dec 3, 2012 at 11:29 pm
    I think your suggestion is a valid one and now I am aware of this I would
    always add this information.

    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupnodejs @
categoriesnodejs
postedDec 3, '12 at 7:37p
activeDec 3, '12 at 11:29p
posts4
users2
websitenodejs.org
irc#node.js

2 users in discussion

Dave Johnson: 3 posts Michal Kruk: 1 post

People

Translate

site design / logo © 2022 Grokbase