1

即使我使用 --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".
4

1 回答 1

4

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

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

或忽略某些路径,例如 node_modules: https ://github.com/remy/nodemon#ignoring-files

于 2015-07-09T08:58:15.560 回答