title: Node.js mailparser module error: Cannot find module 'iconv'
body: <p>I'm working on trying to learn node.js, and am playing around with <a href="https://gist.github.com/1226809" rel="nofollow">the imap and mailparser sample code found here</a>. I installed both <a href="https://github.com/mscdex/node-imap" rel="nofollow">imap</a> and <a href="https://github.com/andris9/mailparser" rel="nofollow">mailparser</a> according to the instructions in the readme documents found on their respective github pages, and everything installed fine without any errors. When attempting to run the sample code, I get the following error:</p>
  
  <p><code>Error: Cannot find module 'iconv'</code></p>
  
  <p>After installing the modules, my project directory structure looks like this:</p>
  
  <pre><code>~/ProjectDir
      |
      -- node_modules
      |   |
      |   -- imap
      |   |   |
      |   |   -- LICENSE
      |   |   -- README.md
      |   |   -- imap.js
      |   |   -- package.json
      |   -- mailparser
      |   |   |
      |   |   -- lib
      |   |   |   |
      |   |   |   -- datetime.js
      |   |   |   -- mailparser.js
      |   |   |   -- streams.js
      |   |   -- node_modules
      |   |   |   |
      |   |   |   -- iconv
      |   |   |   |   ...
      |   |   |   -- mimelib
      |   |   |   |   ...
      |   |   -- test
      |   |   |   ...
      |   |   -- LICENSE
      |   |   -- README.md
      |   |   -- package.json
      |   |       ...
      |   -- config.json
      |   -- mailFether.js
      |   -- readme.md
  </code></pre>
  
  <p>So, based on some of the googling that I've done for this problem, I've noticed that this "Cannot find module" error seems to be a fairly common one, but I've been able to see a consistent solution to the problem.</p>
  
  <p>Is the problem here the nested <code>node_modules</code> directory in the <code>mailparser</code> folder? Should the contents of that folder actually be in the <code>node_modules</code> folder at the root of the project? Is this a project setup issue, or an environmental issue?</p>