如何调试gulpfile.js

cze*_*rny 6 javascript debugging node.js node-inspector gulp

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

我试过跟随(我的gulpfile中的代码需要harmonyharmony-arrow-functions switches):

node-debug --nodejs --harmony --nodejs --harmony-arrow-functions /home/user/.npm-packages/bin/gulp default
Run Code Online (Sandbox Code Playgroud)

节点检查器已正确加载,但是无法在加载文件之前或之后在gulpfile中设置断点.它也不可能设置断点gulp/index.jsorchestrator/index.js文件.并且不可能"进入"以下声明(整个来源):

gulpInst.start.apply(gulpInst, toRun);
Run Code Online (Sandbox Code Playgroud) 环境:
  • Fedora 21 x64
  • Node Inspector v0.9.2
  • 节点v0.12.0
    • CLI版本3.8.11
    • 本地版本3.8.11

los*_*rje 5

看起来你缺少指向你的实际gulpfile.js.尝试这样的事情:

node-debug /path/to/your/gulp/install/gulp.js --harmony --harmony-arrow-functions --gulpfile /path/to/your/gulpfile/gulpfile.js default
Run Code Online (Sandbox Code Playgroud)

我用它,它的工作原理.