我在 Windows 上使用 handlebars 和 nodemon。我注意到(当对 nodemon 使用 debug
参数时),hbs 文件 - 即使它们没有被编辑 - 也会触发 nodemon 更改。
文件真的在改变吗?如果我不编辑它们,为什么它们会发生变化?
[11:22:46] [nodemon] files triggering change check: ..\forgot-sent.hbs
[11:22:46] [nodemon] matched rule: C:\Users\me\Documents\myapp\views/**/*
[11:22:46] [nodemon] changes after filters (before/after): 1/1
[11:22:46] [nodemon] restarting due to changes...
[11:22:46] [nodemon] views\forgot-sent.hbs
如何让nodemon在文件改变时刷新,文件不改变时不刷新?
编辑:看起来像是 nodemon/Windows 上的错误,请参阅 https://github.com/remy/nodemon/issues/1208
最佳答案
这是一个 bug in nodemon (或者更具体地说,chokidar,nodemon 的依赖项)
升级到the latest nodemon得到修复。
关于node.js - 未更改的文件正在触发 nodemon 重新启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49999421/