Assume, you have a Feathers.js app and want to debug it. In this post, we will learn how to debug Feathers.js app using debuggers in Chrome and Webstorm. You need to have Nodemon installed. In this post, we will use Nodemon of version 2.0.4.
You need to create a build of your Feathers.js app to continue with debugging. Usually, you can do this using the
npm run build and it will create
To run a project with debugger you need to pass
inspect flag along with
nodemon. Run this command in your project (
dist/ folder should be in the root):
nodemon --inspect dist/
You should see the Websocket link where you can debug a Node.js application. In our case, it is the Feathers.js app.
You can debug your app directly in Webstorm. Just click on the link from the previous section. Before this, you can set breakpoints in Webstorm IDE.
When breakpoint will be reached you can see information about variables and methods.
To debug the Node.js app in the Chrome browser you need to open Chrome DevTools while
nodemon --inspect is working. You should face a Node.js icon in the top-left corner. Just click on it and you can continue with debugging:
comments powered by Disqus
P.S. This tutorial can be used for another Node.js framework. The approach is the same.