--- tags: vscode, debug javascript --- # How to debug Node.JS Code in VsCode Read this article and follow steps to debug your JavaScript file in VsCode. ## Create JavaScript file to debug I have one JavaScript file that is called `merge-codecoverage.js` ## Create a launch.json in .vscode Create launch.json file in .vscode ![](https://i.imgur.com/ypGZj8k.png) And add below code. Notice in this code I have hard-coded the path of the file that I want to debug at line number 6. ```json= { "version": "0.2.0", "configurations": [ { "name": "Launch Program", "program": "${workspaceFolder}/tools/scripts/merge-codecoverage.js", "request": "launch", "skipFiles": [ "<node_internals>/**" ], "type": "pwa-node" }, ] } ``` ## Hit debug button and see you can debug your code Select the configuration ![](https://i.imgur.com/JRcgDrE.png) Now hit on debug button ![](https://i.imgur.com/0ZSiSlt.png) And then notice you can debug the code. ![](https://i.imgur.com/EDo907D.png) ## Do You Want to become full stack developer? If you want to become full stack developer and grow your carrier as Lead Developer/Architect. Consider subscribing to our full stack development training programs. We have monthly membership plans and you will get unlimited access to all of our video courses, slides, source code & Monthly video calls. - Please visit www.fullstackmaster.net/pro to subscribe to All Access PRO membership. - Please visit www.fullstackmaster.net/elite to subscribe to All Access ELITE membership. You will get everything from PRO plan. Additionally you will get access to monthly live Q&A video call with Rupesh and ask doubts and get more tips and tricks. You bright future is waiting for you so visit today www.fullstackmaster.net and allow me to help you to board on your dream software architect/lead role. --- Rupesh Tiwari www.rupeshtiwari.com fullstackmaster1@gmail.com Founder of www.fullstackmaster.net