【问题标题】:How to debug gulpfile.js如何调试 gulpfile.js
【发布时间】:2015-05-25 22:43:27
【问题描述】:

为了能够调试gulpfile.js,执行node-inspector 的正确方法是什么?

我尝试过以下操作(我的 gulpfile 中的代码需要 harmonyharmony-arrow-functions switches):

node-debug --nodejs --harmony --nodejs --harmony-arrow-functions /home/user/.npm-packages/bin/gulp default

节点检查器已正确加载,但是在文件为 loaded 之前和之后都无法在 gulpfile 中设置断点。也无法在 gulp/index.jsorchestrator/index.js 文件中设置断点。并且不可能“进入”以下语句(whole source):

gulpInst.start.apply(gulpInst, toRun);
环境:
  • Fedora 21 x64
  • 节点检查器 v0.9.2
  • 节点 v0.12.0
  • 一饮而尽
    • CLI 版本 3.8.11
    • 本地版本 3.8.11

【问题讨论】:

    标签: javascript node.js debugging gulp node-inspector


    【解决方案1】:

    您似乎没有指向实际的 gulpfile.js。试试这样的:

    node-debug /path/to/your/gulp/install/gulp.js --harmony --harmony-arrow-functions --gulpfile /path/to/your/gulpfile/gulpfile.js default
    

    我用这个,效果很好。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-04-07
      • 2015-11-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多