title: Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'src'
body: <p>Let's say my app looks like this</p>
  <pre><code>├── index.js
  └── src
      ├── do_foo.js
  </code></pre>
  <p><strong>do_foo.js</strong></p>
  <pre class="lang-js prettyprint-override"><code>function foo() {
      return &quot;bar&quot;;
  }
  
  export default foo;
  </code></pre>
  <p><strong>index.js</strong></p>
  <pre class="lang-js prettyprint-override"><code>import foo from 'src/do_foo';
  
  foo();
  </code></pre>
  <p>Running <code>node index.js</code> results in the following error</p>
  <pre class="lang-sh prettyprint-override"><code>&gt; node index.js
  
  internal/modules/run_main.js:54
      internalBinding('errors').triggerUncaughtException(
                                ^
  
  Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'src' imported from /mnt/c/Users/*******/Projects/*******/index.js
      at packageResolve (internal/modules/esm/resolve.js:620:9)
      at moduleResolve (internal/modules/esm/resolve.js:659:14)
      at Loader.defaultResolve [as _resolve] (internal/modules/esm/resolve.js:752:11)
      at Loader.resolve (internal/modules/esm/loader.js:97:40)
      at Loader.getModuleJob (internal/modules/esm/loader.js:242:28)
      at ModuleWrap.&lt;anonymous&gt; (internal/modules/esm/module_job.js:50:40)
      at link (internal/modules/esm/module_job.js:49:36) {
    code: 'ERR_MODULE_NOT_FOUND'
  }
  npm ERR! code ELIFECYCLE
  npm ERR! errno 1
  npm ERR! fetch_courses@1.0.0 start: `node index.js`
  npm ERR! Exit status 1
  npm ERR!
  npm ERR! Failed at the *******@1.0.0 start script.
  npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
  
  npm ERR! A complete log of this run can be found in:
  npm ERR!     /mnt/c/Users/*******/.npm/_logs/2020-07-21T03_38_34_404Z-debug.log
  </code></pre>
  <p>Seeing as I've managed to mess up at such an early point, the solution, I'd imagine, has to be pretty simple. What cardinal rule of javascript am I violating here?</p>
  <p>I should add that I know everything will work if everything is in the same folder, but that's not what I'm aiming for. If at all possible, it's a better look to keep <code>index.js</code> in the outermost directory.</p>
  <p>Edit: I want to clear up that my problem was <strong>NOT</strong> caused by a typo. My code was syntactically fine, it was the import that needed a relative scope. I mistyped something when I was writing the example code, that had nothing to do with the initial question.</p>