tayask.blogg.se

Webstorm nodejs debug
Webstorm nodejs debug











webstorm nodejs debug
  1. Webstorm nodejs debug code#
  2. Webstorm nodejs debug series#
  3. Webstorm nodejs debug windows#

If you have your Node.js environment correctly setup and grunt-cli package installed globally, two important fields should already be prefilled for you: Among them is also Grunt.js - the one that we need to use. The little "plus" icon in its top left corner opens a menu with a selection of preconfigured templates for debugging different types of Node.js scripts. A proper debug configuration needs to be created for that, using Run/Debug Configurations dialog (accessible via Run > Edit Configurations. It's only a matter of getting used to WebStorm's debugging workflow.Īlthough there's support for temporary debug configurations which can be created ad hoc, this approach can't be used for debugging Grunt scripts.

webstorm nodejs debug

To no surprise, WebStorm has built-in support for debugging all kinds of Node.js scripts, including Gruntfiles. Since I've been recently using WebStorm as my JavaScript IDE of choice, I also wanted to be able to debug my task directly inside it. Have a look at the previous post on Node.js development in our blog: “Getting started with Node.js in WebStorm”.Grunt CoffeeScript WebStorm Creating a Debug ConfigurationĪs soon as I started developing my first Grunt multi task, it became obvious that being able to debug it, will shorten my development time a lot. Please note that for remote debug your app should be running with -debug= or -debug-brk= parameter.

Webstorm nodejs debug code#

You’ll be able to use full-featured debugger in the same way as if you were debugging your code locally.

webstorm nodejs debug

You’ll see the Debug tool window when the breakpoint is reached. Now that the debug configuration is ready, select it from the drop-down list of configurations on the right and click Debug. Select Remote Node.js Debug type when creating a new debug configuration, then specify the host you need to connect to and the port. You’ll be able to restart the debug session without restarting the app itself. With Remote Node.js Debug configuration you can debug Node.js apps that are running remotely. A tool window with variables view, frames and watchers for your debug session will appear:

Webstorm nodejs debug windows#

( Shift+F9 on Windows or Linux, Ctrl+D on Mac). The built-in Node.js debugger allows you to step through the breakpoints, change values on the fly, evaluate expressions, and set watches.Ĭlick the Debug button for the created Run/Debug configuration in the top right-hand corner of the IDE, from the Run menu or with the shortcut The same configuration can be used to debug your Node.js code. The Run tool window with console will appear showing the app execution log. Update: Starting with Express 4.0 file Select this new configuration and click Run. You can also add any parameters you need to pass to node ( Node parameters input) or to your application ( Application parameters input) on the start. For example, for a simple Express web app it should be a file that configures and starts the web server. In this new Run/Debug configuration, specify the path to the JavaScript file that needs to be executed. To create a new Run/Debug configuration, click Edit configurations in the top right corner of the IDE window, or in the main menu Run.Ĭlick Add new configuration and seleсt Node.js type. WebStorm allows you to run Node.js application locally on your machine: you should create a Node.js Run/Debug configuration for the file you need to execute and click Run. Our first post covered the basic WebStorm configuration for working with Node.js projects. Now let’s move on to running and debugging Node.js apps both locally and remotely.

Webstorm nodejs debug series#

Let’s continue our series of posts and tutorials on Node.js development in WebStorm. Check out a newer blog post on debugging Node.js apps.













Webstorm nodejs debug