title: TypeError: Object function EventEmitter()
body: <p>I have Node.js EventEmitter error. When i'm running my script i'm getting this error. Script is under backtrace. It's billing object(it must update money value in MongoDB).</p>
  
  <pre><code>C:\node\billing\node_modules\models\ticket.js:20
  emitter.on('new_bill', function(){
      ^
  TypeError: Object function EventEmitter() {
    this.domain = null;
    if (exports.usingDomains) {
      // if there is an active domain, then attach to it.
      domain = domain || require('domain');
      if (domain.active &amp;&amp; !(this instanceof domain.Domain)) {
        this.domain = domain.active;
      }
    }
    this._events = this._events || {};
    this._maxListeners = this._maxListeners || defaultMaxListeners;
    } has no method 'on'
    at Object.&lt;anonymous&gt; (C:\node\billing\node_modules\models\ticket.js:20:9)
  at Module._compile (module.js:456:26)
  at Object.Module._extensions..js (module.js:474:10)
  at Module.load (module.js:356:32)
  at Function.Module._load (module.js:312:12)
  at Module.require (module.js:364:17)
  at require (module.js:380:17)
  at Object.&lt;anonymous&gt; (C:\node\billing\node_modules\routes\pay.js:1:76)
  at Module._compile (module.js:456:26)
  at Object.Module._extensions..js (module.js:474:10)
  DEBUG: Program node app exited with code 8
  </code></pre>
  
  <p>Here's my script:</p>
  
  <pre><code>var emitter = require('events').EventEmitter;
  var log4js = require('log4js');
  var log = log4js.getLogger();
  var redis = require("redis"),
     client = redis.createClient();
  var HttpError = require('error').HttpError;
  var User = require("models/user").User;
  
  
  function ticket(req, res, next, code, amount){
     this.req = req;
     this.res = res;
     this.next = next;
     this.code = code;
     this.amount = amount;
  }
  
  emitter.prototype = ticket;
  
  emitter.on('new_bill', function(){
     client.set(this.code, this.amount);
  });
  
  
  emitter.on('bill_closed', function(){
     client.get(this.code, function (err, amount) {
          if(err) var err = new HttpError(500, "Redis connection failed");
          log.error(err);
          this.next(err);
          User.upMoney(this.req.session.user._id, amount, function(err){
              if(err) var err = new HttpError(500, "Redis connection failed");
              log.error(err);
              this.next(err);
          });
      });
   });
  
  
  exports.module = emitter;
  </code></pre>
  
  <p>Here, i am using node js with v0.10.25. 
  I didn't find any way to solve this issue in Google. 
  Can anyone help to solve this issue?</p>