I've recently reinstalled node package manager npm install nodemon -g
which grabbed the latest build. But when I run nodemon server.js
and I save changes to files, it's extremely slow to restart the server. It might take 10-30 seconds to detect file changes and when the restart process executes, it can take a few seconds to finish. I'm using nodemon 1.17.3. I don't have this problem on my other build (same PC and same local parent directory) that's using nodemon 1.14.8. Has anyone else experienced this?
Asked
Active
Viewed 5,837 times
13

chasnz
- 179
- 1
- 6
-
which OS? are you running it inside a docker container? – Marcos Casagrande Apr 06 '18 at 03:14
-
1Windows 10. No docker, just localhost. Actually I rolled back to nodemon 1.14.8 and the problem went away. – chasnz Apr 09 '18 at 02:19
-
Also happening in Ubuntu 18.04LTS, nodemon 1.18.10 – Ninja Coding Feb 23 '19 at 19:30
-
1it is also happening to me as well..does anyone have a fix for this? nodemon@1.14.8 does not work for me. im on windows10 btw – Jackie Santana Feb 16 '21 at 06:05
-
2I have the same issue with nodemon 2 (2.0.20) on windows 10 (10.0.19041.2364) – CodeMonkey Dec 24 '22 at 06:17
1 Answers
3
There can be several reasons for the slow server restart. Here are few things you can try
Exclude unnecessary files which doesnt require monitoring from nodemon
Create a nodemon.config.js
file and add the files you dont want nodemon to check while restarting the server
ex:
{
"ignore": [
"node_modules",
"public"
]
}
Or
to check only the changed files you can specify nodemon which files to monitor while restarting the server by --watch
flag
nodemon --watch src/user.model.js
You can also increase the amount of memory available to Node. If your server is slow due to memory limitations you can make the maximum amount of memory availbale (in megabites) by
nodemon --max-old-space-size=4096 app.js
I hope this helps.

Shrey Banugaria
- 122
- 8