linnovate / mean

The MEAN stack uses Mongo, Express, Angular(6) and Node for simple and scalable fullstack js applications
http://mean.io
12.13k stars 3.45k forks source link

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

Closed xkeshav closed 8 years ago

xkeshav commented 9 years ago

I have installed MEAN , it was working yesterday but today it stops working.. http://localhost:3000 is not opening

I don't understand what is wrong?

see the terminal screenshot :

andrija-hers commented 9 years ago

There is a server that's already running, so you cannot start another server.

CharcoalG commented 9 years ago

screenshot from 2015-05-27 11 17 15 on starting the $ nodemon server.js

What to do now?

gichuwil commented 9 years ago

Restart the server [Ctrl+C then nodemon server.js]

CharcoalG commented 9 years ago

No

sivasubramanianp commented 8 years ago

Check all things in render paths

EX:- res.render

sivasubramanianp commented 8 years ago

Reinstall all dependencies

$ npm install

VikramTiwari commented 8 years ago

Fixed.

davidisaza21 commented 8 years ago

Thanks for the fix!

igorg1312 commented 8 years ago

Thank you too. Fixed Il 05 Mag 2016 23:36, "David Isaza" notifications@github.com ha scritto:

Thanks for the fix!

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/linnovate/mean/issues/1066#issuecomment-217287100

jingxingxingzhi commented 8 years ago

Hi, I encountered with the same problem. How do you fix it? Could you describe it in detail? Thanks a lot!

camilosanchez commented 8 years ago

Thank you, I had the same problem, npm install fixed it

Jipsian commented 7 years ago

I encountered with the same problem, but npm install didn't fixed the problem (I tryed a lot of times).

serverpb.txt

Aimanizales commented 7 years ago

Same fucking problem! Still happening after npm install. Nodemon piece of shit

timelf123 commented 7 years ago

@Aimanizales please post the full error message you see, or we can't really help you

@Jipsian that stack trace is not from meanio - the error says your local mongod is not running

sp1d3rino commented 7 years ago

It could be that nodemon is using a server.js that try to connect with mongodb and if you don't have mongod up and running then nodemon fails to start

Hardik21 commented 7 years ago

I want to it restart automatically after app crashed. I use nodemon in live project. so it is not possible every time to restart server.

Shamel1 commented 7 years ago

I am having the same problem. image

Shamel1 commented 7 years ago

I need help..new to this.

liorkesos commented 7 years ago

Seems your mongodb is down or mongo is not installed. Try to connect via the cli and verify it's up Lior

On Sat, Mar 18, 2017 at 9:46 PM, Sandra Hamel notifications@github.com wrote:

I need help..new to this.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/linnovate/mean/issues/1066#issuecomment-287570015, or mute the thread https://github.com/notifications/unsubscribe-auth/AAO9I8Y7HS6f7M0DGyf6bahs-TwasI5Sks5rnDSpgaJpZM4DjLuL .

--

Lior Kesos - http://www.linnovate.net Linnovate - Community Infrastructure Care mail: lior@linnovate.net office: +972 722500881 cell: +972 524305252 skype: liorkesos

praWINK commented 7 years ago

I am also having this same issue...anyone solved this issue???

RayanaAlencar commented 7 years ago

Hi all, I was with the same problem. The problem was that I forgot to start the mongo (sudo mongod) before run my server.

Hardik21 commented 7 years ago

Have you tried with PM2 plugin. This plugin is best solution ever. Once you start with this plugin, after then never required to start it again.

Have a look this link: PM2 npm

kidkat commented 7 years ago

@Jipsian did you found how to fix the problem ? Please can you help me 2 ?

shubhamduttasd commented 7 years ago

stiil now no solution for this??

shubhamduttasd commented 7 years ago

screenshot from 2017-06-16 16-05-24

shubhamduttasd commented 7 years ago

i am facing problem regarding this any solutn??

timelf123 commented 7 years ago

Upgrade your node version

SunShinewyf commented 7 years ago

I encountered with the same problem, but npm install didn't fixed the problem and my mongodb is running , don't know the reason.

Hardik21 commented 7 years ago

can you send me error screenshot?

LfifteenA commented 7 years ago

This happened to me and I realized it was because I was on the wrong Git Hub branch. I had cloned and forgot to checkout the clone/branch before running terminal commands. If you cloned/checked-out, make sure you are running your npm install and npm run dev AFTER "git checking out" the right branch / folder

giiska commented 7 years ago

The latest Nodemon seems still have this bug.

MsaadAl commented 7 years ago

The error 90% will be in your package json file, check out the json file package and see if you miss something in there. it happened to me sometimes and I most of the time i find the error in the json file.

Anakin1093 commented 7 years ago

try having node 8.1.1 sometimes the system reverts to an older version of node. i did the following: $ nvm install 8.1.1 $ npm run dev and it worked !

poonam-dev commented 7 years ago

error

valmirbekteshi commented 6 years ago

just go to task manager and find the node js server , process and end it, and type nodemon in your terminal , done.

vikalpveer commented 6 years ago

Most likely your node daemon is still running. ps -eaf | grep node

ubuntu 23504 1 0 20:37 pts/0 00:00:00 node /home/ubuntu/project/XXXXX/node_modules/.bin/nodemon server.js

ubuntu 24433 23504 0 22:47 pts/0 00:00:00 sh -c node server.js

ubuntu 24434 24433 0 22:47 pts/0 00:00:00 node server.js

ubuntu 24619 23932 0 22:50 pts/1 00:00:00 grep --color=auto node

if your output is something like above, you already have node server running.

use killall to kill all process sand restart daemon. eg: killall node

sedkis commented 6 years ago

If you are on windows, I have found when I ctrl+c in terminal or git terminal, it doesn't kill the process. I have to end the task through task manager.

However, when I run the server on a PowerShell, it's a lot smoother. That is what I suggest running your server on.

alexmanoliu commented 6 years ago

just go in task manager, kill mongodb and nodejs sever running, close your app and reopen it.It will work, i been trying a fix the last hour and npm install wasnt doing it.

andreobueno commented 6 years ago

I had the same problem... the way you fix it is easy. Do as it follows: 1 - go to package.json and and change the "main": "index.js" to "main": "app.js". In this case, my main is app.js, as in the majority of the MEAN tutorials on the internet. 2 - run nodemon again.

I hope it helps you as well :)

LfifteenA commented 6 years ago

If you've installed any other dependencies they may be causing an error. I think I ask a question 6 months ago because I had downloaded Heroku, node, Vue, and a bunch of other stuff all in the same day and there were issues with which versions I was using.

Anywho, not that I know which database or servers you're using but Roku caused a lot of my issues so just because myair seem to be Heroku based, I pasted some info Heroku FAQ re:node below .

DISCLAIMER: Don't take my word for it I don't really know node well enough to be troubleshooting for anyone 🙄 but this heroku article might give you some ideas and other weird errors that might be happening.

https://devcenter.heroku.com/articles/troubleshooting-node-deploys#ensure-you-aren-t-relying-on-untracked-dependencies

per FaQ above: "Each time you run npm install, npm leaves packages that meet your semver requirements untouched. That’s why an npm install today may lead to a different tree than the npm install you ran yesterday, even if your package.json didn’t change.

Therefore, it’s a good practice to periodically clear node_modules and reinstall from scratch to ensure that your package.json dependencies are still valid:

$ rm -rf node_modules $ npm install --quiet --production $ npm start

In fact, those are essentially the commands that Heroku runs when we build and launch your project. If they work locally, you’re likely to be cloud-ready.

Alternatively, you can add yarn or npm-shrinkwrap to your workflow to lock down dependency versions so that they are consistent from install to install. This is the best practice for production environments."

Good luck. If all else fails quit everything, turn off your computer, let it sit for a while and restart it and sometimes that works

GodEngine commented 6 years ago
  1. $ cd /usr/local/qconf/bin
  2. $ sudo chmod 777 agent-cmd.sh
  3. $ vim agent-cmd.sh
  4. modify the line 355(add "#" before "flock -n -e 200")
  5. save and quit
  6. $ sudo sh agent-cmd.sh start
  7. good luck
umeklinks commented 6 years ago

To fix the crashing, go to your app.js. If you have these lines of code. Its normally of the very first lines...

import { Socket } from 'dgram';

const express = require('express'); const bodyParser = require('body-parser'); const ejs = require('ejs'); const Nexmo = require('nexmo'); const socketio = require('socket.io');


Simply delete/remove the first line of code import { Socket } from 'dgram';

and restart your application using "nodemon"

Did it work?

ifredom commented 6 years ago
  1. close the cmd,and restart。

  2. if it's Still appear

It means that it has not been turned off and opened the task manager to turn off the node process.

Ding-Fan commented 6 years ago

For my situation, I change the express port from 80 to 8090, then it works.

devils-ey3 commented 6 years ago

For linux user use this command fuser -ntcp -k your_port_number_that_listen_the_server

francadaval commented 6 years ago

I had a similar problem. In my case was nothing to do with nodemon. It was that the node version didn't allow --debug because it's deprecated. I used --inspect instead and then it worked for me.

In those cases, you should downgrade node version or use --inspect.

kumaresan-in commented 6 years ago

Solution is here with simple steps

http://devfacts.com/nodemon-app-crashed-error-fix/

devils-ey3 commented 6 years ago

@kumaresan-in This is not watching your file....

heiliuer commented 6 years ago

'npm i' solved it, but why?

Meghana64 commented 6 years ago

screenshot 20 My mongod server was running but still it showing above issue, what's the reason. What should i do? Can u plz help me out...