How do I debug a Node.js server application?
Right now I\'m mostly using alert debugging with print statements like this:
sys.puts(sys.inspe
Just for completeness:
The PyCharm 3.0 + Node.js Plugin offers an awesome development + run + debug experience.
Visual Studio Code will be my choice for debugging. No overhead of installing any tools or npm install
stuff.
Just set the starting point of your app in package.json and VSCode will automatically create a configuration file inside your solution. It's build on Electron, on which editors like Atom are built.
VS Code gives similar debugging experience as you might have had in other IDEs like VS, Eclipse, etc.
If you are using the Atom IDE, you can install the node-debugger
package.
Using Chrome Version 67.0.3396.62(+)
node --inspect-brk=0.0.0.0:9229 server.js(server js filename)
There will be another DevTools window that will pop out specifically for debugging node app.
Node.js Tools for Visual Studio 2012 or 2013 includes a debugger. The overview here states "Node.js Tools for Visual Studio includes complete support for debugging node apps.". Being new to Node.js, but having a background in .NET, I've found this add in to be a great way to debug Node.js applications.
Use Webstorm! It's perfect for debugging Node.js applications. It has a built-in debugger. Check out the docs here: https://www.jetbrains.com/help/webstorm/2016.1/running-and-debugging-node-js.html