How to debug Node in VSCode? The following article will introduce to you the method of debugging Node.js in VSCode. I hope it will be helpful to you!
Because VSCode
has a built-in Node debugger, debugging Node is extremely simple, follow these steps. [Recommended learning: "vscode tutorial"]
Find the Run And Debug
button in the ToolBar And click, or directly <Command Shift D>
to open debugging
Select Run Current File
Run Current File For debugging NodeJS, it is just a click. How to debug
Typescript and more complex large projects?
ts file that needs to be debugged, how should it be handled?
Open Terminal
Click the small button
on the right side of the panel, and continue to click Javascript Debug Terminal
to open the JS debugable terminal
The following is an example (although it is not particularly complicated), abstracting the startup command as
npm start. <div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush:js;toolbar:false;">{
"scripts": {
"start": "NODE_ENV=production node index.js"
}
}</pre><div class="contentsignin">Copy after login</div></div>
The second step, enter the command in the debuggable terminal
The third step, start debugging
More programming related knowledge, Please visit:
Introduction to ProgrammingThe above is the detailed content of A brief analysis of the method of debugging Node.js in VSCode. For more information, please follow other related articles on the PHP Chinese website!