title: Clearing require cache
body: <p>I am trying to delete a module from cache as <a href="https://stackoverflow.com/q/9210542/1420197">suggested here</a>.</p>
  <p>In the <a href="http://nodejs.org/docs/latest/api/globals.html#globals_require_cache" rel="noreferrer">documentation</a> we read:</p>
  <blockquote>
  <h2>require.cache</h2>
  <ul>
  <li>Object</li>
  </ul>
  <p>Modules are cached in this object when they are required. <strong>By deleting a key value from this object, the next require will reload the module.</strong></p>
  </blockquote>
  <p>So, I created a file named <code>1.js</code> that contains a single line:</p>
  <pre><code>module.exports = 1;
  </code></pre>
  <p>Then I require it via <code>node</code> shell:</p>
  <pre><code>ionicabizau@laptop:~/Documents/test$ node
  &gt; require(&quot;./1&quot;)
  1
  &gt; require.cache
  { '/home/ionicabizau/Documents/test/1.js': 
     { id: '/home/ionicabizau/Documents/test/1.js',
       exports: 1,
       parent: 
        { id: 'repl',
          exports: [Object],
          parent: undefined,
          filename: '/home/ionicabizau/Documents/test/repl',
          loaded: false,
          children: [Object],
          paths: [Object] },
       filename: '/home/ionicabizau/Documents/test/1.js',
       loaded: true,
       children: [],
       paths: 
        [ '/home/ionicabizau/Documents/test/node_modules',
          '/home/ionicabizau/Documents/node_modules',
          '/home/ionicabizau/node_modules',
          '/home/node_modules',
          '/node_modules' ] } }
  # edited file to export 2 (module.exports = 2;)
  &gt; require.cache = {}
  {}
  &gt; require.cache
  {}
  &gt; require(&quot;./1&quot;) // supposed to return 2
  1
  </code></pre>
  <p>So, why does <code>require(&quot;./1&quot;)</code> return <code>1</code> when my file contains <code>module.exports = 2</code> and the cache is cleared?</p>
  <p>Doing some debugging I saw that there is a <code>Module._cache</code> object that is not cleared when I do <code>require.cache = {}</code>.</p>