title: Node.js app, Express and Cloud Foundry
body: <p>I am using out of the box expressjs app, and I'm using node 0.8.2. Works great locally, but when I push to the Cloud Foundry I get the following error, and I have no idea where to start with debugging. I'm assuming that this is caused by a configuration issue or a dependency issue, but I don't know what to do. </p>
  
  <p><strong>Express
  500 TypeError: Object # has no method 'randomBytes'</strong>
  at Object.uid (/var/vcap/data/dea/apps/dwgapp1-0-690016dc6c7142f385b44b144d3d380e/app/node_modules/express/node_modules/connect/lib/utils.js:122:17)
  at MemoryStore.generate (/var/vcap/data/dea/apps/dwgapp1-0-690016dc6c7142f385b44b144d3d380e/app/node_modules/express/node_modules/connect/lib/middleware/session.js:203:27)
  at generate (/var/vcap/data/dea/apps/dwgapp1-0-690016dc6c7142f385b44b144d3d380e/app/node_modules/express/node_modules/connect/lib/middleware/session.js:281:13)
  at Object.session [as handle] (/var/vcap/data/dea/apps/dwgapp1-0-690016dc6c7142f385b44b144d3d380e/app/node_modules/express/node_modules/connect/lib/middleware/session.js:290:7)
  at next (/var/vcap/data/dea/apps/dwgapp1-0-690016dc6c7142f385b44b144d3d380e/app/node_modules/express/node_modules/connect/lib/proto.js:190:15)
  at Object.cookieParser [as handle] (/var/vcap/data/dea/apps/dwgapp1-0-690016dc6c7142f385b44b144d3d380e/app/node_modules/express/node_modules/connect/lib/middleware/cookieParser.js:60:5)
  at next (/var/vcap/data/dea/apps/dwgapp1-0-690016dc6c7142f385b44b144d3d380e/app/node_modules/express/node_modules/connect/lib/proto.js:190:15)
  at Object.methodOverride [as handle] (/var/vcap/data/dea/apps/dwgapp1-0-690016dc6c7142f385b44b144d3d380e/app/node_modules/express/node_modules/connect/lib/middleware/methodOverride.js:37:5)
  at next (/var/vcap/data/dea/apps/dwgapp1-0-690016dc6c7142f385b44b144d3d380e/app/node_modules/express/node_modules/connect/lib/proto.js:190:15)
  at multipart (/var/vcap/data/dea/apps/dwgapp1-0-690016dc6c7142f385b44b144d3d380e/app/node_modules/express/node_modules/connect/lib/middleware/multipart.js:62:61)</p>
  
  <pre><code>    var express = require('express')
         , routes = require('./routes')
         , user = require('./routes/user')
         , http = require('http')
         , path = require('path');
  
      var app = express();
  
      app.configure(function(){
         app.set('port', process.env.VCAP_APP_PORT || 3000);
         app.set('views', __dirname + '/views');
         app.set('view engine', 'ejs');
         app.use(express.favicon());
         app.use(express.logger('dev'));
         app.use(express.bodyParser());
         app.use(express.methodOverride());
         app.use(express.cookieParser('your secret here'));
         app.use(express.session());
         app.use(app.router);
         app.use(require('stylus').middleware(__dirname + '/public'));
         app.use(express.static(path.join(__dirname, 'public')));
      });
  
      app.configure('development', function(){
         app.use(express.errorHandler());
      });
  
      app.get('/', routes.index);
      app.get('/users', user.list);
  
      http.createServer(app).listen(app.get('port'), function(){
         console.log("Express server listening on port " + app.get('port'));
      });
  </code></pre>