title: Error: Cannot find module './models/modela'
body: <p>I have a problem with my app, the files' tree is:</p>
  
  <pre><code>│   app.js
  │   package-lock.json
  │   package.json
  │
  ├───models
  │       modela.js
  │       seedDB.js
  │
  └───views
      │   index.ejs
      │   landing.ejs
      │   new.ejs
      │   show.ejs
      │
      └───partials
              footer.ejs
              header.ejs
  </code></pre>
  
  <p>I am getting an error with models for Mongoose</p>
  
  <pre><code>internal/modules/cjs/loader.js:800
      throw err;
      ^
  
  Error: Cannot find module './models/modela'
  Require stack:
  - E:\Project\models\seedDB.js
  - E:\Project\app.js
      at Function.Module._resolveFilename (internal/modules/cjs/loader.js:797:15)
      at Function.Module._load (internal/modules/cjs/loader.js:690:27)
      at Module.require (internal/modules/cjs/loader.js:852:19)
      at require (internal/modules/cjs/helpers.js:74:18)
      at Object.&lt;anonymous&gt; (E:\project\models\model-b.js:2:20)
      at Module._compile (internal/modules/cjs/loader.js:959:30)
      at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
      at Module.load (internal/modules/cjs/loader.js:815:32)
      at Function.Module._load (internal/modules/cjs/loader.js:727:14)
      at Module.require (internal/modules/cjs/loader.js:852:19)
      at require (internal/modules/cjs/helpers.js:74:18)
      at Object.&lt;anonymous&gt; (E:\project\app.js:6:14)
      at Module._compile (internal/modules/cjs/loader.js:959:30)
      at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
      at Module.load (internal/modules/cjs/loader.js:815:32)
      at Function.Module._load (internal/modules/cjs/loader.js:727:14) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
      'E:\\project\\models\\seed.js',
      'E:\\project\\app.js'
    ]
  }
  </code></pre>
  
  <p>My app.js file consist of-</p>
  
  <pre><code>const express  = require('express'),
      app        = express(),
      bodyParser = require("body-parser"),
      mongoose   = require("mongoose"),
      projectItem = require("./models/modela");
      seedDB = require("./models/seedDB");
  
  seedDB();
  </code></pre>
  
  <p>modela consist of</p>
  
  <pre><code>var mongoose   = require("mongoose");
  var projectItemSchema = new mongoose.Schema({
      name: String,
      image: String,
      description: String
  });
  module.exports = mongoose.model("projectItem",projectItemSchema)
  
  </code></pre>
  
  <p>seedDB consist of</p>
  
  <pre><code>const mongoose   = require("mongoose");
  const Campground = require("./models/modela");
  
  function seedDB() {
      projectItem.remove({}, function(err){
          if(err){
              console.log(err);
          }
          console.log("all projectItem removed");
      });
  }
  
  module.exports = seedDB;
  </code></pre>
  
  <p>can anyone help me..
  when I am writing everything in my app.js (start file), there is no error app is running fine..
  getting this issue when I am making a separate Schema-model file.. </p>