【发布时间】:2020-07-16 19:59:21
【问题描述】:
我使用nodemon 作为节点中的开发依赖项。突然,在 CLI 中显示:
[nodemon] 由于更改而重新启动...
当我更改代码时。然后我已经全局安装了 nodemon 但它仍然无法正常工作。它不适用于任何项目——不是单个项目。
有什么帮助吗?我附上了我的 CLI 的屏幕截图:
【问题讨论】:
标签: nodemon node.js nodemon reactjs
我使用nodemon 作为节点中的开发依赖项。突然,在 CLI 中显示:
[nodemon] 由于更改而重新启动...
当我更改代码时。然后我已经全局安装了 nodemon 但它仍然无法正常工作。它不适用于任何项目——不是单个项目。
有什么帮助吗?我附上了我的 CLI 的屏幕截图:
【问题讨论】:
标签: nodemon node.js nodemon reactjs
可能是因为starting更新了一个服务器正在监视的文件,所以在无限循环中触发了restart事件。
Nodemon 支持--watch 和--ignore 命令。和他们一起玩,只看一组特定的文件。示例:
# Only watch the "server" directory
nodemon --watch server server/main.js
# Watch both the "server" and "client" directory
nodemon --watch server --watch client server/main.js
# Watch the "server" directory, but ignore "server/logs"
nodemon --watch server --ignore server/logs server/main.js
【讨论】:
app.js 做了什么。我不知道你的项目是什么样子的。 Please read the guide on asking questions :)