title: Can't import module in node/express js
body: <p>I am getting an error when importing files into my node js server file.
  I usually do it in this way and all the paths are correct so I'm not sure what the error is.</p>
  <pre><code>import express from 'express'
  import mongoose from 'mongoose'
  
  import data from '../data.js'
  import Page from &quot;../models/pageModel.js&quot;;
  
  const app = express()
  mongoose.connect(process.env.MONGODB_URL || 'mongodb://localhost/note-guard', {
    useNewUrlParser: true,
    useUnifiedTopology: true,
    useCreateIndex: true,
  });
  
  app.get('/', (req, res) =&gt; {
      res.send('Server is ready');
    });
  app.use('/api/pages/:id', async (req, res) =&gt; {
    const createdPages = await Page.insertMany(data.pages);
    console.log(createdPages);
    res.send(&quot;test&quot;);
  })
  
  const port = process.env.PORT || 5002;
  app.listen(port, () =&gt; {
    console.log(`Serve at http://localhost:${port}`);
  });
  </code></pre>
  <p>This is the error I get:</p>
  <pre><code>internal/process/esm_loader.js:74
      internalBinding('errors').triggerUncaughtException(
                                ^
  
  Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/charlielamb/Desktop/learnCode/note-guard/data.js' imported from /Users/charlielamb/Desktop/learnCode/note-guard/backend/server.js
      at finalizeResolution (internal/modules/esm/resolve.js:265:11)
      at moduleResolve (internal/modules/esm/resolve.js:699:10)
      at Loader.defaultResolve [as _resolve] (internal/modules/esm/resolve.js:810:11)
      at Loader.resolve (internal/modules/esm/loader.js:88:40)
      at Loader.getModuleJob (internal/modules/esm/loader.js:241:28)
      at ModuleWrap.&lt;anonymous&gt; (internal/modules/esm/module_job.js:56:40)
      at link (internal/modules/esm/module_job.js:55:36) {
    code: 'ERR_MODULE_NOT_FOUND'
  }
  </code></pre>
  <p>Any help?</p>