1

I have a node.js code in WebStorm. I debug the code by using node.js configuration and it works fine.

However, once I run debug mode in npm configuration, WebStorm ignores the breakpoints. I tried to add the variables "--debug" and "--debug-brk" to 'Arguments' field and it still didn't solve the problem.

enter image description here

2 Answers 2

1

Please check out this tutorial: http://pavelpolyakov.com/2016/05/01/webstorm-npm-tasks-debug/ You need to add $NODE_DEBUG_OPTION in your npm script. Here's the original issue on the WebStorm tracker.

Sign up to request clarification or add additional context in comments.

2 Comments

With Node v8.10.0 and Mac OS 10.13.6 and chrome 69 I can't get it working given the hints jetbrains.com/help/webstorm/run-debug-configuration-npm.html and blog.jetbrains.com/webstorm/2018/01/how-to-debug-with-webstorm
Please provide a bit more details about the error you get. You can contact the WebStorm tech support using this form: intellij-support.jetbrains.com/hc/en-us/requests/new
0

You need to add $NODE_DEBUG_OPTION (or %NODE_DEBUG_OPTION% on Windows) in your npm script. Please note that NODE_DEBUG_OPTION should be placed right after node, where node parameters are expected, for example:

  "scripts": {
    "start": "node $NODE_DEBUG_OPTION ./bin/www"
  }

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.