title: Node js and phantomjs - Cannot find module 'weak'
body: <p>I am running on Linux Mint 16 'petra' 64 bit, and I am trying to use 'phantomjs' for the first time, together with node js.</p>
  
  <p>I have installed phantomjs globally:</p>
  
  <pre><code>sudo npm install -g phantomjs
  </code></pre>
  
  <p>... and confirmed that it is running (I get the phantomjs prompt by running "phantomjs" in terminal)</p>
  
  <p>and I have installed the node 'phantom' module within my node project:</p>
  
  <pre><code>npm install phantom
  </code></pre>
  
  <p>So far so good.</p>
  
  <p>However, within my application code, as soon as it attempts to execute this line:</p>
  
  <pre><code>var phantom = require('phantom');
  </code></pre>
  
  <p>... the program crashes with the following trace:</p>
  
  <pre>
  Listening on port 3000
  about to instantiate phantom module...
  module.js:333
      throw err;
            ^
  Error: Cannot find module 'weak'
      at Function.Module._resolveFilename (module.js:331:15)
      at Function.Module._load (module.js:273:25)
      at Module.require (module.js:357:17)
      at require (module.js:373:17)
      at new D (/home/joe/Documents/My Stuff/Programming/Angular.js Projects/NodeJS Messing/FreeAgentScraper/node_modules/phantom/node_modules/dnode/index.js:28:20)
      at module.exports (/home/joe/Documents/My Stuff/Programming/Angular.js Projects/NodeJS Messing/FreeAgentScraper/node_modules/phantom/node_modules/dnode/index.js:8:12)
      at /home/joe/Documents/My Stuff/Programming/Angular.js Projects/NodeJS Messing/FreeAgentScraper/node_modules/phantom/phantom.js:135:13
      at Server.handler (/home/joe/Documents/My Stuff/Programming/Angular.js Projects/NodeJS Messing/FreeAgentScraper/node_modules/phantom/node_modules/shoe/index.js:22:9)
      at Server.EventEmitter.emit (events.js:104:17)
      at App.emit (/home/joe/Documents/My Stuff/Programming/Angular.js Projects/NodeJS Messing/FreeAgentScraper/node_modules/phantom/node_modules/shoe/node_modules/sockjs/lib/sockjs.js:182:27)
      at Session.emit_open (/home/joe/Documents/My Stuff/Programming/Angular.js Projects/NodeJS Messing/FreeAgentScraper/node_modules/phantom/node_modules/shoe/node_modules/sockjs/lib/transport.js:107:23)
  </pre>
  
  <p>I can confirm that indeed there is no 'weak.js' anywhere in the project.</p>
  
  <p>I have run 'npm install' to ensure that all dependencies have been installed.</p>
  
  <p>Google search hasn't revealed anything worthwhile. Can anyone offer any advice?</p>