【问题标题】:Nodeunit debugging in windowsWindows中的Nodeunit调试
【发布时间】:2015-05-04 13:34:09
【问题描述】:

我正在尝试在运行 nodeunit 时调试测试,并尝试在 this SO Question 中进行解释,但在尝试时它在 Windows 中不起作用。

    d:\code\path>node --debug-brk `which nodeunit` test\tests.js
    Debugger listening on port 5858
    module.js:338
        throw err;
              ^
    Error: Cannot find module 'd:\code\path\`which'
        at Function.Module._resolveFilename (module.js:336:15)
        at Function.Module._load (module.js:278:25)
        at Module.runMain [as _onTimeout] (module.js:501:10)
        at Timer.listOnTimeout (timers.js:110:15)

我正在 Windows 中尝试此操作,并且 node_path 在系统变量中。

【问题讨论】:

    标签: node.js nodeunit


    【解决方案1】:

    which是一个unix命令,反引号中的`which nodeunit`表示:'在这里打印nodeunit命令的路径'

    遗憾的是,在 windows 上无论是 wich 还是反引号都不起作用,所以你必须手动完成。

    类似的命令是where,所以你可以运行'where nodeunit',记下输出然后rune

    node  --debug-brk c:\....\nodeunit test\tests.js
    

    【讨论】:

      猜你喜欢
      • 2013-05-15
      • 1970-01-01
      • 2015-04-25
      • 2013-08-02
      • 2012-06-25
      • 1970-01-01
      • 1970-01-01
      • 2011-09-11
      • 2011-10-17
      相关资源
      最近更新 更多