title: Node.js unable to import ES6 module
body: <p>I'm trying to separate my routes to a separate module in <code>routes.js</code> and then importing in <code>app.js</code>. I'm getting a lot of errors in the console.</p>
  
  <p><code>internal/modules/esm/default_resolve.js:96
    let url = moduleWrapResolve(specifier, parentURL);
              ^
  Error: Cannot find module /Users/rhoxh/Desktop/24/routes imported from /Users/rhoxh/Desktop/24/app.js
      at Loader.resolve [as _resolve] (internal/modules/esm/default_resolve.js:96:13)
      at Loader.resolve (internal/modules/esm/loader.js:73:33)
      at Loader.getModuleJob (internal/modules/esm/loader.js:147:40)
      at ModuleWrap.&lt;anonymous&gt; (internal/modules/esm/module_job.js:41:40)
      at link (internal/modules/esm/module_job.js:40:36) {
    code: 'ERR_MODULE_NOT_FOUND'
  }</code></p>
  
  <p>routes.js</p>
  
  <pre><code>import express from 'express';
  
  const router = express.Router();
  
  router.get('/', (req, res) =&gt; {
    res.send('home page');
  });
  
  export default router;
  </code></pre>
  
  <p>app.js</p>
  
  <pre><code>import express from 'express';
  import { router } from './routes';
  
  const app = express();
  const PORT = 8080;
  
  app.listen(PORT, () =&gt; {
    console.log(`Server running at: http://localhost:${PORT}/`);
  });
  
  // Routes
  app.use('/', router);
  </code></pre>
  
  <p>What am I doing wrong here?</p>