In this article I will detail how I setup a debug configuration in webstorm in order to debug hexo. The information contained here can easily be applied to debugging any node app that is executed with a command lined command (
hexo generate) instead of the more standard
When setting up a node debug configuration in Webstorm you have to specify a file path. Since we are trying to debug
The trick here is to specify the path to the hexo executable located in
When adding your configuration, use the following:
|Node Interpreter||Path to Node||/usr/local/bin/node (on OSX)|
|Node Parameters||Node args to specify debug mode||--debug-brk|
|Working Directory||Project Directory||path/to/project|
|Application Parameters||CLI command args||generate|
Once you are done, set up a breakpoint somewhere and hit the debug button.
Thanks to this Stack Overflow Post for pointing me in the right direction.
You can refer to it if you wish to use
node-inspector instead of Webstorm to do your debugging.