title: internal/modules/cjs/loader.js:638 throw err
body: <p>I was created angular project and try to connect mongodb database using db.js file.and also i am getting error: Cannot find module.
  what should i do ?
  please help me</p>
  <pre><code>internal/modules/cjs/loader.js:638
  throw err;
  ^
  
  Error: Cannot find module 'C:\Users\user\Desktop\angularproject\db.js'
  at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)  
  at Function.Module._load (internal/modules/cjs/loader.js:562:25)
  at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
  at startup (internal/bootstrap/node.js:283:19)
  at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
  </code></pre>
  <p>My db.js file contains following code</p>
  <pre><code>const mongoose = require('mongoose');
  
  mongoose.connect('mongodb://localhost:27017/CrudDB',(err) =&gt; {
  if(!err)
  console.log('MongoDB connection succeed.');
  else
  console.log('Error in DB connection:'+ JSON.stringify(err,undefined,2));
  });
  
  module.exports = mongoose;
  </code></pre>