Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Webstorm: debugging node.js sails app

I'm having a hard time finding the right combination of settings to allow me to debug my node.js sails application in webstorm.

These are the settings I've tried using, both configurations work (as in sails starts) but none is stopping at breakpoints.

enter image description here

enter image description here

If I go to the breakpoints menu and turn on 'Any exception enabled' - it does stop for exceptions, but never hits my breakpoints.

Any ideas? I'm on webstorm 7.0.1 and Node 0.10.18 / Sails 0.9.7

like image 937
Madd0g Avatar asked Oct 29 '13 16:10

Madd0g


People also ask

How do I debug Nodejs server WebStorm?

To start debugging, hold Ctrl+Shift and click the link. WebStorm starts a debugging session with an automatically generated Attach to Node. js/Chrome configuration.

How do I debug Nodejs app?

Open the starting file (typically index. js ), activate the Run and Debug pane, and click the Run and Debug Node. js (F5) button. The debugging screen is similar to Chrome DevTools with a Variables, Watch, Call stack, Loaded scripts, and Breakpoints list.

How do you debug sails?

For Node v6 and above, use sails inspect . Attach the node debugger and lift the Sails app (similar to running node --debug app. js ). You can then use node-inspector to debug your app as it runs.

How do I debug next JS in WebStorm?

Just hold Ctrl+Shift / ⌘⇧ and click the URL address where the application is running. WebStorm launches the auto generated Debug Application run/debug configuration, the browser opens at http://localhost:3000/, and the Debug tool window appears showing you the call stack and variables.


2 Answers

You don't need the --debug in node parameters. Here is my config and i am on 7.0.1 and node 0.10.4

enter image description here

Let me know if it helped. Also, you are hitting the bug to run debug right? enter image description here

Also, can you please invalidate caches/ restart? That helps sometimes. Here is a snapshot in the file menu. enter image description here

like image 110
Pradeep Mahdevu Avatar answered Nov 15 '22 09:11

Pradeep Mahdevu


I had the same problem and simply installed sails local to the project and everything worked fine. Not sure why the configuration can't resolve the globally installed sails as that is the error I was getting, but the local install works fine. I should investigate further, but I'm lazy :)

like image 45
Randy Brown Avatar answered Nov 15 '22 09:11

Randy Brown