Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8996275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:43:58+00:00 2026-06-15T23:43:58+00:00

I have my node.js app with dependencies { name: application-name, version: 0.0.1, private: true,

  • 0

I have my node.js app with dependencies

{
  "name": "application-name",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node app"
  },
  "dependencies": {
    "express": ">=2.2.0",
    "jade": "*",
    "stylus": "*",
    "mongodb": ">= 0.9.6-7"
  }

}

it is working fine on my localhost

When i am hosting my node app on heroku i am getting the following error.

TypeError: Object # has no method ‘randomBytes’
at Object.uid (/app/node_modules/express/node_modules/connect/lib/utils.js:121:17)
at MemoryStore.generate (/app/node_modules/express/node_modules/connect/lib/middleware/session.js:204:27)
at generate (/app/node_modules/express/node_modules/connect/lib/middleware/session.js:288:13)
at Object.session [as handle] (/app/node_modules/express/node_modules/connect/lib/middleware/session.js:297:7)
at next (/app/node_modules/express/node_modules/connect/lib/proto.js:190:15)
at Object.cookieParser [as handle] (/app/node_modules/express/node_modules/connect/lib/middleware/cookieParser.js:60:5)
at next (/app/node_modules/express/node_modules/connect/lib/proto.js:190:15)
at Object.expressInit [as handle] (/app/node_modules/express/lib/middleware.js:31:5)
at next (/app/node_modules/express/node_modules/connect/lib/proto.js:190:15)
at Object.query [as handle] (/app/node_modules/express/node_modules/connect/lib/middleware/query.js:44:5)

I tried to remove lines one by one and get to this where i removed

app.use(express.session({ secret:'yodawgyo' }));

The app was giving the “Hello World” response.
See my complete code below.

var express = require('express');
var crypto = require('crypto');//for gravatar

var passport = require('passport')
  , OpenIDStrategy = require('passport-openid').Strategy
  , GoogleStrategy = require('passport-google').Strategy
  , AOLStrategy = require('passport-aol').Strategy
  , YahooStrategy = require('passport-yahoo').Strategy;;



passport.serializeUser(function(user, done) { 
  done(null, user);
});

passport.deserializeUser(function(obj, done) {
  done(null, obj);
});

var app = module.exports = express();

app.configure(function(){
  app.set('views', __dirname + '/views');
  app.set('view engine', 'jade');
  app.use(express.cookieParser());


//NO ISSUES WITH HEROKU IF I COMMENTED BELOW LINE   
  app.use(express.session({ secret:'yodawgyo' }));


  app.use(app.router);

});

app.get('/', function(req, res) {
  res.send("Hello World");
});

app.listen(process.env.PORT || 5000, function() {
  console.log("listening on 5000");
});

Please help me out.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T23:43:59+00:00Added an answer on June 15, 2026 at 11:43 pm

    I was having the same issue. It was resolved by adding the “engines” block to package.json which directs Heroku to use a specific version of node and npm. Most likely you are using a much newer version of node than the Heroku default 0.4.7

    See https://devcenter.heroku.com/articles/nodejs-support#versions

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this package.json file: { name: application-name , version: 0.0.1 , private: true
I have a node.js + express.js app that uses jade.js as the templating language.
I have a Node.js app using Express that stores data in a mongoDB (locally).
I have the following express node.js app. It's using the 'redis' npm package. app.get(/test,function(req,res){
I have a JavaScript data structure like the following in my Node.js/Express web app:
When I start up my application in node.js node app.js and then make a
I have an express node app, and I'm trying to keep my code neat
I have a node.js chat app that uses socket.io and other dependencies but I
I have one node app running and I want to try the express framework
This is driving me insane. I have a node app with express. It serves

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.