title: "type": "module" in package.json throw new ERR_REQUIRE_ESM(filename, parentPath, packageJsonPath)
body: <p>I want to use import in my nodejs project instead of using require. 
  So, I added,</p>
  
  <pre><code>"type": "module"
  </code></pre>
  
  <p>in my <strong>package.json</strong>.</p>
  
  <pre><code>import index from './index.js';
  </code></pre>
  
  <p>in <strong>server.js</strong></p>
  
  <p>when I run </p>
  
  <blockquote>
    <p><em>node server.js</em></p>
  </blockquote>
  
  <p>Error says,</p>
  
  <pre><code>internal/modules/cjs/loader.js:1174
        throw new ERR_REQUIRE_ESM(filename, parentPath, packageJsonPath);
        ^
  
        throw new ERR_REQUIRE_ESM(filename, parentPath, packageJsonPath);
        ^
  
  Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: ....
  </code></pre>
  
  <p><strong>server.conf.js</strong> is pasted below.</p>
  
  <pre><code>import express from 'express';
  
  import http from 'http';
  let app = express();
  let server = http.createServer(app);
  
  import morgan from 'morgan';
  import methodOverride from 'method-override';;
  import path from 'path';
  
  let port = process.env.PORT || 4000;
  app.use(morgan('dev'));
  app.use(methodOverride('X-HTTP-Method-Override'));
  let router = express.Router();
  import routes from '../app/routes';
  routes(app, router, client);
  server.listen(port);
  console.log(`Wizardry is afoot on port ${port}`);
  export {
      app,
      client
  };
  </code></pre>