What is the proper way to execute node-inspector
in order to be able to debug gulpfile.js
?
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
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);
Environment:
Put a debugger in where you want it to stop. Then run gulp test to get the browser open. Open Chrome Dev Tool. Run again, it should stop at the debugger.
Run a Gulp Task in Visual Studio CodeType "Run Task" and select it, which will bring up a list of tasks configured in Gulp. Choose the Gulp Task you want to run! Most of your Gulp Tasks will probably be automated using gulp watch, but manual Gulp Tasks can easily be run within Visual Studio Code.
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
I use this and it works.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With