問題描述
為了能夠調(diào)試 gulpfile.js
,執(zhí)行 node-inspector
的正確方法是什么?
What is the proper way to execute node-inspector
in order to be able to debug gulpfile.js
?
我嘗試過以下操作(我的 gulpfile 中的代碼需要 harmony
和 harmony-arrow-functions 開關(guān)
):
I've tried following (code in my gulpfile requires harmony
and harmony-arrow-functions switches
):
node-debug --nodejs --harmony --nodejs --harmony-arrow-functions /home/user/.npm-packages/bin/gulp default
節(jié)點檢查器已正確加載,但是在文件之前或之后都無法在 gulpfile 中設(shè)置斷點 已加載.也無法在 gulp/index.js
和 orchestrator/index.js
文件中設(shè)置斷點.并且不可能進入"以下語句(整個源):
Node inspector was properly loaded however it was not possible to set breakpoint in gulpfile neither before nor after the file was loaded. It was also not possible to set breakpoints in gulp/index.js
and orchestrator/index.js
files. And it was not possible to "step into" following statement (whole source):
gulpInst.start.apply(gulpInst, toRun);
環(huán)境:
- Fedora 21 x64
- 節(jié)點檢查器 v0.9.2
- 節(jié)點 v0.12.0
- 一飲而盡
- CLI 版本 3.8.11
- 本地版本 3.8.11
推薦答案
看起來你缺少指向你實際的 gulpfile.js.試試這樣的:
It looks like you're missing pointing to your actual gulpfile.js. Try something like this:
node-debug /path/to/your/gulp/install/gulp.js --harmony --harmony-arrow-functions --gulpfile /path/to/your/gulpfile/gulpfile.js default
我用這個,效果很好.
這篇關(guān)于如何調(diào)試 gulpfile.js的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!
【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!