I am trying to use node-inspector debug a nodeJS app running with babel-node.
babel-node index.js --debug
Node-inspector works but it shows the source maps in the transpiled es5 instead of es6
Before we can get into how to debug a node.js server, we have to get into its more specific use-cases. Node Inspector is a great tool to be used for debugging Node.js applications using the Opera or Chrome browser. You can easily debug through all code blocks of JavaScript code by using its interface.
Node Inspector is a debugger interface for Node.js applications that use the Blink Developer Tools. Node.js provides a built-in DevTools-based debugger which mostly deprecates Node Inspector.
Node Inspector is a great tool to be used for debugging Node.js applications using the Opera or Chrome browser. You can easily debug through all code blocks of JavaScript code by using its interface. Node Inspector has some of the following useful features that it provides to debug Node.JS based applications.
Node.js applications are written in JavaScript and can be run in the runtime Node.js on OS X, Microsoft Windows, and Linux. It’s also lightweight, efficient, and its ability to use JavaScript on both frontend and backend opens new development paths. Not surprisingly, many large companies have exploited Node.js in production.
For babel 6, I used the require hook.
Follow these instructions to get babel register. https://babeljs.io/docs/setup/#babel_register
In your app.js or entrypoint to the application add
require('babel-register')({
sourceMaps: true
});
If you need to add other options as well, see - https://babeljs.io/docs/usage/options/#options
You should be able to use node-inspector & chrome to to debug your application
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