title: Class instantiation
body: <p>I followed this example: <a href="https://stackoverflow.com/questions/10772102/coffeescript-and-node-js-confusion-require-instantiates-class">Coffeescript and node.js confusion. require instantiates class?</a>, but it doesn't seem to work - the error is <code>TypeError: undefined is not a function</code>, so I must be doing something wrong. I have a simple coffee-script executable. Here are my steps:</p>
  
  <p>Create a folder structure:</p>
  
  <p>appmq</p>
  
  <ul>
  <li><p>my_executable</p></li>
  <li><p>my_class.coffee</p></li>
  <li><p>package.json</p></li>
  </ul>
  
  <p>The file contents:</p>
  
  <p><code>package.json</code>:</p>
  
  <pre><code>{
      "name": "appmq",
      "version": "0.0.1",
      "description": "xxxxxx",
      "repository": "",
      "author": "Frank LoVecchio",
      "dependencies": {
      },
      "bin": {"appmq": "./my_executable"}
  }
  </code></pre>
  
  <p><code>my_executable</code>:</p>
  
  <pre><code>#!/usr/bin/env coffee
  {CommandLineTools} = require './my_class'
  cmdTools = new CommandLineTools()
  
  cmdTools.debug()
  </code></pre>
  
  <p><code>my_class</code>:</p>
  
  <pre><code>class CommandLineTools
  
    debug: () -&gt;
      console.log('Version: ' + process.version)
      console.log('Platform: ' + process.platform)
      console.log('Architecture: ' + process.arch)
      console.log('NODE_PATH: ' + process.env.NODE_PATH)
  
  module.exports = CommandLineTools
  </code></pre>
  
  <p>I then install the application via:</p>
  
  <p><code>sudo npm install -g</code></p>
  
  <p>Then I run the application (which produces the error I noted above):</p>
  
  <p><code>appmq</code></p>