visual-studio-codenodemon

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?


Solution

  • 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.