問題描述
為了能夠調試 gulpfile.js
,執行 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 開關
):
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
節點檢查器已正確加載,但是在文件之前或之后都無法在 gulpfile 中設置斷點 已加載.也無法在 gulp/index.js
和 orchestrator/index.js
文件中設置斷點.并且不可能進入"以下語句(整個源):
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);
環境:
- Fedora 21 x64
- 節點檢查器 v0.9.2
- 節點 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
我用這個,效果很好.
這篇關于如何調試 gulpfile.js的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!