need help sorting through NodeJS debugging configuration choicea

I'm having problems figuring out which the various NodeJS debugging configuratios I need to use for the following scenario

NodeJS running locally on localhost.
Need to set breakpoints.
Application is an html page which loads the JS I need to debug.

I've tried setting up both Node.js and Node.js Remote Debug ( as host).  When I start the session, I see only "Connecting to" in Debugger pane

The Node.js Remote Debug configuration:
Debug Port: 5858
Local directory:   C:\Projects\...\myapp\angular
Remote Path:  C:\Projects\...\myapp\develop.html

I am primarily concentrating on the Node.js configuration working as I think this is what I want.

The Node.js configuration:
Path to Node: C:\Program Files (x86)\nodejs\node.exe
Node Parameters: --debug-brk=5858
Working Directory:  C:\Projects\...\myapp\angular
Path to Node App JS File:  C:\Projects\...\myapp\develop.html

It blows up html fetch as it appears to expect a js file only.

(function (exports, require, module, __filename, __dirname) { <!doctype html>
SyntaxError: Unexpected token <

My question which NodeJS configuration for running Node locally serving an initial html page (index.html)

Thanks in advance for any help.

1 comment
Comment actions Permalink

Why are you using Node.js configuration here? Seems your application is a front-end Angular application. Why not using JavaScript Debug run configuration?The simplest way to create it is right-clicking your .html file and choosing 'Create 'develop.html'' - yourhtml page will be served by the built-in webserver

Or, do you have the Node.js server that serves your client code? You need to create a Node.js run configuration to start your server and a separate javascript debug run configuration for client side then. Or, specify your page URL in the Browser/Live Edit tab of Node.js run configuration

See also:,


Please sign in to leave a comment.