title: Can I use bare imports for my local modules using native es6 modules (mjs)?
body: <h1>Background:</h1>
  
  <p>Assuming my folder structure is something like:</p>
  
  <pre><code>  project/
     -- package.json
     -- index.mjs
     -- lib/
         -- config/
             -- index.mjs
  </code></pre>
  
  <p>When I used <code>require()</code> natively in node I could reference a local module using a bare import like:</p>
  
  <p><code>const x = require('config')</code></p>
  
  <p>because I added the root of my library folder to the <code>NODE_PATH</code> environment variable. (assuming of course when I was using cjs/require the extension would have been <code>.js</code>)</p>
  
  <h1>The problem:</h1>
  
  <p>When I try to do that using native es6 modules (mjs) like:</p>
  
  <p><code>import x from 'config'</code></p>
  
  <p>I get the error:</p>
  
  <p><code>
  Error [ERR_MODULE_RESOLUTION_LEGACY]: config not found by import in [SOME_ABS_PATH]/index.mjs. Legacy behavior in require() would have found it at [SOME_ABS_PATH]/lib/config/index.mjs
  </code></p>
  
  <h1>The question:</h1>
  
  <p>Anyone know how to solve this? Or what the future is for dealing with relative paths for local module resolution within the node native es6 module system?</p>
  
  <h1>Research so far:</h1>
  
  <p>Only resource I've found on this so far is from here <a href="http://2ality.com/2017/09/native-esm-node.html" rel="nofollow noreferrer">http://2ality.com/2017/09/native-esm-node.html</a> stating:</p>
  
  <blockquote>
    <p>Path resolution works slightly differently: ESM does not support NODE_PATH and require.extensions. And its specifiers always being URLs also leads to a few minor differences.</p>
  </blockquote>
  
  <p>And on the error message below <code>ERR_MODULE_RESOLUTION_LEGACY</code> - google showed up literally nothing.</p>