【问题标题】:Nodemon is not working : [nodemon] restarting due to changesNodemon 不工作:[nodemon] 由于更改而重新启动
【发布时间】:2020-07-16 19:59:21
【问题描述】:

我使用 作为节点中的开发依赖项。突然,在 CLI 中显示:

[nodemon] 由于更改而重新启动...

当我更改代码时。然后我已经全局安装了 nodemon 但它仍然无法正常工作。它不适用于任何项目——不是单个项目。

有什么帮助吗?我附上了我的 CLI 的屏幕截图:

【问题讨论】:

    标签: nodemon node.js nodemon reactjs


    【解决方案1】:

    可能是因为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
    

    【讨论】:

    • 那么我应该在 package.json 中写什么,例如 "start": "nodemon app.js"
    • 我不知道。我不知道app.js 做了什么。我不知道你的项目是什么样子的。 Please read the guide on asking questions :)
    猜你喜欢
    • 2019-03-23
    • 2022-11-24
    • 2021-10-02
    • 2018-07-10
    • 2021-11-05
    • 2020-08-21
    • 2020-06-15
    • 2021-01-10
    相关资源
    最近更新 更多