4

How do you run and debug an interactive Node.js app (one that prompts the user to enter STDIN on the console) in VS Code using a simple launch (F5). I have so far been running the app using node --inspect-brk . and then attaching VS Code. This works fine, but I'm just wondering if there's a faster way. If I look at the DEBUG CONSOLE pane, I can see the STDOUT, but I can't add input there.

4
  • do you use a launch.conf file? Commented Mar 4, 2018 at 2:36
  • 1
    You'll find your answer here: code.visualstudio.com/docs/nodejs/… Commented Mar 4, 2018 at 2:39
  • Thanks, Randy. The file is launch.json to be accurate. I was using one, but was unaware of the console parameter. Commented Mar 4, 2018 at 13:06
  • sorry - that was off the top of my head. should have confirmed. Thanks the correction.Glad you got it sorted Commented Mar 4, 2018 at 15:21

1 Answer 1

5

Randy's comment was my answer with a link here. Thanks, Randy.

The solution is to configure the console value in your launch.json file. I added "console": "integratedTerminal" and now when I hit F5 I can jump to the integrated terminal (CTRL+<backtick>) and interact with my app.

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.