Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

nodemon recursive watch issue?

I have installed nodemon using command:

npm install nodemon -g

Having done that I changed "start": "node ./bin/www" to "start": "nodemon ./bin/www"

Output in Console on running npm start :

[nodemon] 1.11.0
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `nodemon  ./bin/www ./bin/www`
[nodemon] 1.11.0
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `nodemon  ./bin/www ./bin/www ./bin/www`
[nodemon] 1.11.0
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `nodemon  ./bin/www ./bin/www ./bin/www ./bin/www`
and so on....

Where am I going wrong? Please bear in mind that this is my 3rd day on nodejs so keep it simple.

Edit

 "scripts": {
    "start": "nodemon app.js"
  },

enter image description here

enter image description here

"nodemon app.js" seems to work since the console does not show any errors but then I am unable to run the application. However if I change it back to node ./bin/www it would work.

like image 855
SamuraiJack Avatar asked Feb 18 '17 17:02

SamuraiJack


1 Answers

Try to downgrade requirements. This helped me.

npm install [email protected] -g

I reproduced this issue in docker image (node:alpine) with nodemon >1.2.0 100%. And v1.1.0 and v1.2.0 have some strange issues too.

I checked only minor releases (w/o checking patchlevels e.g. 1.2.1, 1.2.2 and others)

So. 1.0.0 is old, but works well.

On my host Mac I have [email protected] installed globally. Sometimes I have this issue and sometimes I don't. This is somehow connected with pwd and nodemon.json file. But I'm not sure.

I found a bug report related to this problem.

like image 191
akaRem Avatar answered Oct 16 '22 17:10

akaRem