title: nodemon - app crashed - waiting for file changes before starting
body: <p>I just started learning Node.js. The idea of this small application is to use express and mongosse to store some users in a based cloud database (mongoDB via mlab).</p>
  
  <p>I have two seperate files :</p>
  
  <p>User.js (models/User.js)</p>
  
  <pre><code>var mongoose = require('mongoose');
  
  module.exports = mongoose.model('User', {
  
     email : string ,
     pwd : string
  
  });
  </code></pre>
  
  <p>server.js (dossier root)</p>
  
  <pre><code>var express = require('express')
  var cors = require('cors')
  var bparser = require('body-parser')
  var mongoose = require('mongoose')
  
  var User = require('./models/User.js')
  
  var app = express()
  
  app.use(cors())
  app.use(bparser.json())
  
  app.post('/register', (req,res) =&gt; {
      userData = req.body;
      var user = new User(userData);
  
      user.save((err, result) =&gt; {
          if(err) console.log('IL YA UNE ERREUR')
          result.sendStatus(200);
      })
  
  })
  
  mongoose.connect('mongodb://user:pwd@ds261755.mlab.com:61755/myapp', { useMongoClient: true } , (erreur) =&gt; {
      if(!erreur) 
      console.log('Connexion etablie');
  })
  
  
  app.listen(3000)
  </code></pre>
  
  <p>When I execute : <code>nodemon server.js</code>, I get the error below:</p>
  
  <pre><code>D:\Bureau\MEAN\appBackend\models\User.js:5
     email : string ,
             ^
  
  ReferenceError: string is not defined
      at Object.&lt;anonymous&gt; (D:\Bureau\MEAN\appBackend\models\User.js:5:12)
      at Module._compile (module.js:570:32)
      at Object.Module._extensions..js (module.js:579:10)
      at Module.load (module.js:487:32)
      at tryModuleLoad (module.js:446:12)
      at Function.Module._load (module.js:438:3)
      at Module.require (module.js:497:17)
      at require (internal/module.js:20:19)
      at Object.&lt;anonymous&gt; (D:\Bureau\MEAN\appBackend\server.js:6:12)
      at Module._compile (module.js:570:32)
      at Object.Module._extensions..js (module.js:579:10)
      at Module.load (module.js:487:32)
      at tryModuleLoad (module.js:446:12)
      at Function.Module._load (module.js:438:3)
      at Module.runMain (module.js:604:10)
      at run (bootstrap_node.js:389:7)
  [nodemon] app crashed - waiting for file changes before starting...
  </code></pre>
  
  <p>Do you have any idea about this error?</p>