【问题标题】:Nodemon crashes :TypeError: Cannot read property '__nodemonRestart' of nullNodemon 崩溃:TypeError:无法读取属性 '__nodemonRestart' of null
【发布时间】:2019-12-04 05:35:38
【问题描述】:

我使用 Nodemon 通过 Node.js(VS Code IDE)运行我的代码。我只是一个初学者,需要一些指导来解决这个问题。每次代码出现错误时,Nodemon 都会开始崩溃(我在 VS Code 中选择了自动保存选项)。错误如下:

at Function.Module._load (internal/modules/cjs/loader.[nodemon] app crashed - waiting for file changes before starting...
C:\Users\bobsa\AppData\Roaming\npm\node_modules\nodemon\lib\monitor\run.js:149
      if (child.__nodemonRestart) { // this flag is set right before the kill
                ^

TypeError: Cannot read property '__nodemonRestart' of null

我是否必须更改 run.js 文件中的“__nodemonRestart”?我已经用最新版本更新了 nodemon,但问题是一样的。

【问题讨论】:

    标签: node.js nodemon


    【解决方案1】:

    当我将 nodemon 更新到版本 2.0.1 时,我也遇到了这种情况。你可能想回到你以前的状态。只需运行这行代码npm i -g nodemon@your.old.version,例如npm i -g nodemon@1.19.4(这只是一个示例)

    版本历史

    2.0.1........................ 11 days ago
    
    2.0.1-alpha.3........................ 12 days ago
    
    2.0.1-alpha.2........................ 12 days ago
    
    2.0.1-alpha.1........................ 12 days ago
    
    2.0.0........................ 13 days ago
    
    1.19.4........................ 2 months ago (this one is working fine for me)
    
    1.19.3........................ 2 months ago
    
    1.19.2........................ 3 months ago
    
    1.19.1........................ 6 months ago
    
    1.19.0........................ 7 months ago
    
    1.18.11........................ 8 months ago
    
    

    编码愉快!!!!!

    【讨论】:

    • 感谢您的帮助,我认为它解决了问题:)
    猜你喜欢
    • 2017-10-29
    • 1970-01-01
    • 1970-01-01
    • 2020-11-02
    • 2020-11-01
    • 2020-01-29
    • 2020-02-05
    • 2016-01-09
    • 2019-02-09
    相关资源
    最近更新 更多