NODEMON -- app crashed - waiting for file changes before starting

Nick Schmitt picture Nick Schmitt · Aug 16, 2018 · Viewed 11.9k times · Source

I'm following this tutorial.

When I run npm run server, as at 13:10 in the video, I get the error:

[nodemon] app crashed - waiting for file changes before starting...

Why does this happen? Is Port 5000 already in use?


Here's the terminal:

#########:MERN_SHOPPING_LIST #######$ npm run server

[email protected] server /Users/MyName/Documents/Web Dev/MERN_SHOPPING_LIST
nodemon server.js
[nodemon] 1.18.3
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `node server.js`
/Users/MyName/Documents/Web Dev/MERN_SHOPPING_LIST/server.js:1
(function (exports, require, module, __filename, __dirname) { const express = required('express');
                                                                              ^
ReferenceError: required is not defined
    at Object.<anonymous> (/Users/MyName/Documents/Web Dev/MERN_SHOPPING_LIST/server.js:1:79)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Function.Module.runMain (module.js:693:10)
    at startup (bootstrap_node.js:191:16)
    at bootstrap_node.js:612:3
[nodemon] app crashed - waiting for file changes before starting...

Answer

Aneel Khalid picture Aneel Khalid · May 10, 2019

Simple Answer is:

Go to Mongodb cluster and edit the IPwhitelist and refresh it

then connect it again problem solve.

Happy Coding