1

I spent lot of time to find out how I can debug simple node.js file in webstorm. after writing simple api in node.js I stuck at some place and looking for solution where i can debug line by line. I am using Web-storm editor. I will also contribute if find some way.

1
  • 1
    Welcome to SO, please be a bit more specific when asking question: what have you tried, what do you expect, etc. See how to ask Commented Mar 17, 2016 at 5:39

1 Answer 1

2

Steps to Debug Node JS code


  • Open console and type node(it will open node shell).
  • Run process.env
  • Copy the contents of the PATH value
  • Add an environment variable to Webstorm called PATH that uses this value. It will overwrite the default PATH variable that Webstorm gives your app.

How to add environment variable to Webstorm.


  • Click on file name on right top corner.
  • Click on Edit configuration and click Environment Variables.
  • Click on + button and paste value of PATH variable value. enter image description here

Now we are done with setup of debug.

Steps to debug

Place break point in code and hit API through browser/POSTMAN.

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

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.