Nodemon 这可能会导致高 cpu 使用率。减少使用--watch
Nodemon This might cause high cpu usage. To reduce use --watch
即使我 运行 nodemon 和 --watch ..
我也会收到警告
$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".
减少将要观看的文件数量。您必须指定要观看的目录: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
即使我 运行 nodemon 和 --watch ..
我也会收到警告$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".
减少将要观看的文件数量。您必须指定要观看的目录: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