【问题标题】:Cannot find module '_debugger' while using jasmine-debug or jasmine-node-debug使用 jasmine-debug 或 jasmine-node-debug 时找不到模块“_debugger”
【发布时间】:2018-02-21 17:00:44
【问题描述】:

我使用 jasmine 编写的测试很少。我想调试这些测试,所以我正在使用 jasmine-debug 模块

sh-3.2# jasmine-debug
module.js:540
    throw err;
    ^

Error: Cannot find module '_debugger'
    at Function.Module._resolveFilename (module.js:538:15)
    at Function.Module._load (module.js:468:25)
    at Module.require (module.js:587:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/jasmine-debug/node_modules/node-inspector/lib/debugger.js:2:16)
    at Module._compile (module.js:643:30)
    at Object.Module._extensions..js (module.js:654:10)
    at Module.load (module.js:556:32)
    at tryModuleLoad (module.js:499:12)
    at Function.Module._load (module.js:491:3)

我使用的是 npm 版本:5.6.0 和节点版本:8.9.4

我有点想通 node-inspector 似乎与新版本的 Node 不兼容,但是我如何绕过调试 jasmine 测试。

我尝试的其他选项是 Karma,但使用的是 Bookshelf.js,这使得浏览器变得困难。

如果有人能帮助我找到调试 Jasmine 测试的方法,我会很高兴。 因为我才刚开始,我什至可以切换到摩卡。

【问题讨论】:

    标签: node.js jasmine jasmine-node


    【解决方案1】:

    这不是答案,而是替代解决方案:

    我也遇到了类似的问题,但我使用了 IntelliJ IDEA 以及 IntelliJ IDEA 的节点插件 https://www.jetbrains.com/help/idea/run-debug-configuration-mocha.html

    【讨论】:

      猜你喜欢
      • 2014-02-21
      • 2014-04-21
      • 1970-01-01
      • 1970-01-01
      • 2016-06-29
      • 2016-10-17
      • 2017-11-28
      • 2016-05-14
      • 1970-01-01
      相关资源
      最近更新 更多