title: "Learning Node JS" example - 'The super constructor to "inherits" must not ' +'
body: <p>I'm fowolling along to exercise in the O'Reilly "Learning Node JS" book and I've run into an unrunnable example. My code is as follows: </p>
  
  <pre><code>"use strict";
  
  var util = require('util');
  var eventEmitter = require('events').eventEmitter;
  var fs = require('fs')
  
  function InputChecker(name, file) {
      this.name = name;
      this.writeStream = fs.createWriteStream('./' + file + '.txt',
          {'flags': 'a',
           'encoding': 'utf8', 
           'mode' : 0o666});
  };
  
  util.inherits(InputChecker, eventEmitter);
  
  InputChecker.prototype.check = function check(input) {
      let command = input.trim().substr(0,3);
      if (command == 'wr') {
          this.emit('write', input.substr(3, input.length));
      } else if (command == 'en:') {
          this.emit('end');
      } else {
          this.emit('echo', input);
      }
  };
  
  let ic = new InputChecker('Shelley', 'output');
  
  ic.on('write', function(data) {
      this.writeStream.write(data, 'utf8');
  });
  
  ic.on('echo', function(data) {
      process.stdout.write(ict.name + ' wrote ' + data);
  });
  
  ic.on('end', function() {
      process.exit();
  });
  
  process.stdin.setEncoding('utf8');
  process.stdin.on('readable', function() {
      let input = process.stdin.read();
      if (input != null)
          ic.check(input);
  });
  </code></pre>
  
  <p>The error is: </p>
  
  <pre><code>[user@MacBook-Pro NodeJS]$ node fileevent.js   
  util.js:957
  throw new TypeError('The super constructor to "inherits" must not ' +
  ^
  
  TypeError: The super constructor to "inherits" must not be null or undefined
  at Object.exports.inherits (util.js:957:11)
  at Object.&lt;anonymous&gt; (/Users/user/Documents/NodeJS/fileevent.js:15:6)
  at Module._compile (module.js:570:32)
  at Object.Module._extensions..js (module.js:579:10)
  at Module.load (module.js:487:32)
  at tryModuleLoad (module.js:446:12)
  at Function.Module._load (module.js:438:3)
  at Module.runMain (module.js:604:10)
  at run (bootstrap_node.js:389:7)
  at startup (bootstrap_node.js:149:9)`
  </code></pre>
  
  <p>Any help is appreciated! TIA!</p>