【问题标题】:Nodemon This might cause high cpu usage. To reduce use --watchNodemon 这可能会导致 CPU 使用率过高。减少使用 --watch
【发布时间】:2015-07-09 17:04:16
【问题描述】:

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

【问题讨论】:

    标签: node.js nodemon


    【解决方案1】:

    减少将被观看的文件数量。您必须指定要观看的目录: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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-12-07
      • 1970-01-01
      相关资源
      最近更新 更多