Search code examples
node.jsdebuggingwebstormnode-debugger

How to debug core library of node in WebStorm?


In WebStorm I could go into _stream_readable.js belonging to Node core library by using Force Step Into button. But I couldn't add any breakpoints there.

Meanwhile I can do this in Chrome Devtools where there is a limitation you need http server to connect Chrome Dev with Node Application. It is not convenient sometimes.

Is there any way to debug core code in WebStorm?

enter image description here

enter image description here


Solution

  • Chrome Dev Tools deal with runtime code loaded in VM, WebStorm - with source files available on your disk. You can't create breakpoints in files that don't exist in your project/libraries. But you can step into runtime code while debugging.

    Node.js Core library created by Webstorm for Node.js code completion (Settings | Languages & Frameworks | Node.js and NPM, Node.js Core) includes fs.js, stream.js, etc. - all core modules provided by builtin-modules module, so some of the core files are available locally and included in project and thus accessible to the IDE. But undocumented and similar modules, like _stream_readable are not included.