title: npm run test gives Error [ERR_MODULE_NOT_FOUND]: Cannot find module
body: <p>I am working on a nodejs project where I am writing test cases using mocha but it does not find local modules.</p>
  <p>error: Error [ERR_MODULE_NOT_FOUND]: Cannot find module '' import from ''
  at new NodeError (node:internal/errors:371:5)
  at finalizeResolution (node:internal/modules/esm/resolve:416:11)
  at moduleResolve (node:internal/modules/esm/resolve:932:10)
  at defaultResolve (node:internal/modules/esm/resolve:1044:11)
  at ESMLoader.resolve (node:internal/modules/esm/loader:422:30)
  at ESMLoader.getModuleJob (node:internal/modules/esm/loader:222:40)
  at ModuleWrap. (node:internal/modules/esm/module_job:76:40)
  at link (node:internal/modules/esm/module_job:75:36)</p>
  <p>other node scripts are defined in package.json:</p>
  <pre><code>{
     &quot;scripts&quot;: {
        &quot;doJob&quot;: &quot;node ./node_modules/babel-cli/bin/babel-node.js  --presets node8 ./doJob.js&quot;,
        &quot;test&quot;: &quot;mocha&quot;
     }
  }
  </code></pre>
  <p>doJob script works fine.</p>
  <p>how can I make use of babel-cli with mocha.</p>