Nodemon这可能会导致CPU使用率过高。 减less使用 – 观察

即使使用–watch运行nodemon,我也会收到警告。

$nodemon app.js --watch 9 Jul 09:09:16 - [nodemon] v1.3.7 9 Jul 09:09:16 - [nodemon] to restart at any time, enter `rs` 9 Jul 09:09:16 - [nodemon] watching: *.* 9 Jul 09:09:16 - [nodemon] starting `node app.js` Example app listening at http://:::3000 9 Jul 09:09:16 - [nodemon] watching 32,639 files - this might cause high cpu usage. To reduce use "--watch". 

减less将要观看的文件的数量。 你必须指定你想要看的目录: https : //github.com/remy/nodemon#monitoring-multiple-directories

您也可以通过指定要观看的文件扩展名来减less这个数字: https : //github.com/remy/nodemon#specifying-extension-watch-list

或者忽略像node_modules这样的特定path,例如: https : //github.com/remy/nodemon#ignoring-files