title: Express module.js:550 throw err; ^ Cannot find module
body: <p>I'm trying to initialize a simple express app with the following code:</p>
  
  <pre><code>const express = require('express');
  const app = express()
  const bodyParser = require('body-parser');
  const cookieParser = require('cookie-parser');
  const mongoose = require('mongoose');
  port = 3000
  
  
  //creating the db
  mongoose.connect('mongodb://localhost:27017/Criptare',{ useNewUrlParser: true,
  useCreateIndex: true });
  let db = mongoose.connection
  db.on('error',console.error.bind(console,"connection error"));
  
  //parsers 
  app.use(cookieParser());
  app.use(bodyParser.json());
  app.use(bodyParser.urlencoded({extended: false}));
  
  //session LATER
  
  
  //static files
  app.use('/static',express.static('public'));
  
  //view engine PUG
  app.use('view-engine','pug');
  
  //Routes
  const mainRoutes = require('./routes/main')
  app.use(mainRoutes)
  
  //error handle
  app.use((req,res,next)=&gt;{
      let err = new Error('Looks like the page you were looking for was not found')
      err.status = 404;
      next(err)
  })
  app.use((err,req,res,next)=&gt;{
      res.locals.error = err
      res.status(err.status);
      res.render('error')
  });
  app.listen(port,()=&gt;{
      console.log(`No bun serveru ii on pe ip-ul:localhost:${port}`)
  })
  </code></pre>
  
  <p>After I run it with nodemon I get the following error:</p>
  
  <pre><code>module.js:550
  throw err;
  ^
  Cannot find module 'C:\Proiecte code\ON\express\criptare\index.js'
      at Function.Module._resolveFilename (module.js:548:15)
      at Function.Module._load (module.js:475:25)
      at Function.Module.runMain (module.js:694:10)
      at startup (bootstrap_node.js:204:16)
      at bootstrap_node.js:625:3
  </code></pre>
  
  <p>Anyone has any idea why I'm getting this?
  I have all the dependencies inside the package.json</p>