Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

nodemon "restarting due to changes..." repeatedly displays in VSCode and slows down every restarting process

I use nodemon version 1.18.9 (Latest version as of today).

I use Visual Studio Code (VSCode). I open a terminal and execute nodemon dev-server.js but it displays this repeatedly

restarting due to changes...

as follows

nodemon-restarting

and after a few seconds it will complete its restarting process.

I use Windows 10.

Any suggestions?

like image 999
holydragon Avatar asked Jan 16 '19 03:01

holydragon


1 Answers

package.json

   {
      "scripts": {
        "nodemon": "nodemon dev-server.js"
      },
    }

start nodemon by npm

$ npm run nodemon
save dev-server.js file, nodemon will restart twice

start nodemon direct

$ nodemon dev-server.js
save dev-server.js file, nodemon is all right

osx 10.11.3
nodemon 1.9.2

=============UPDATED ANSWER FROM COMMENTS======================

updating answer from comments as logic from comments worked for this problem.

try adding delay for some time. let me know if it works. nodemon lib/dev-server.js --delay 1 ..

whatever your directory is.

like image 104
Jabongg Avatar answered Nov 15 '22 09:11

Jabongg