- Install JDK and Eclipse IDE on your Windows PC. If you do not know how to do it, please read the article Beginner’s Guide For Install JDK(Java Development Kit) And Eclipse In Windows.
- Now you can see test.js in the left project explorer.
3. Setup Debug Runtime Configuration.
- Click Eclipse toolbar Window —> Preferences menu.
- Click Add button to add Node.js runtime environment. This needs you first install node.js on your PC. You can read the article How To Install Node JS In Windows to learn more. I recommend you install node.js windows binary edition which is unzipped from a zip file.
- I recommend you use node version 7.10.1 because it is a more stable version, if you use version 8 or 9 when you start debugging, it may through the below error message.
(node:10012) [DEP0062] DeprecationWarning: `node –debug` and `node –debug-brk` are invalid. Please use `node –inspect` or `node –inspect-brk` instead.Failed to connect to Standalone V8 VM
- Right-click the js file in the left panel, choose Debug As —> Debug Configurations menu. It will popup a dialog that lets you configure debug parameters.
I just test the above procedure with Eclipse Neon.3 Release ( 4.6.3 ) and node version 7.10.1. These two components are stable to use.
If you use Node.js version 8 or 9, then you may encounter debug start failed error with the below error message.
(node:10012) [DEP0062] DeprecationWarning: `node --debug` and `node --debug-brk` are invalid. Please use `node --inspect` or `node --inspect-brk` instead. Failed to connect to Standalone V8 VM
To fix this error, you can refer to the comments https://www.dev2qa.com/how-to-run-debug-node-js-application-with-eclipse/#comment-95159
My running node.js version is version 8. I use visual studio NTVS to debug a node.js project and got the error as this article discussed (node:10012) [DEP0062] DeprecationWarning:
node --debug-brkare invalid. Please use
node --inspect-brkinstead. Failed to connect to Standalone V8 VM.
I can see from the error message that visual studio needs me to use node –inspect to replace the node –debug option to debug the node js project. But I do not know how to do it. Can anybody give me some help? Thanks.
This is because since Node.js version 7.7, the node –debug and node –debug-brk option has been deprecated. Visual studio wants to support debugging all Node.js version, so it use a combination options which contains both –inspect and –debug-brk instead.
To fix this issue, you can try the below steps.
Change “protocol”: “legacy”, to “protocol”: “auto”, in the launch.json file.
You can also add the –inspect-brk in package.json file like below.
"debug": "DEBUG=pd* nodemon --inspect-brk --harmony --nolazy server.js"
Now visual studio code will change the default debug settings to below.
Kindly explain step by step how to do that.
I encountered the error stated above. ((node:12884) [DEP0062] DeprecationWarning: `node –debug` and `node –debug-brk` are invalid. Please use `node –inspect` or `node –inspect-brk` instead.
Failed to connect to Standalone V8 VM).
Is anyone able to help me rectify this error? I have been stuck on this for a few days. Kindly assist.
Same issue ,
Can someone help
If you use Node.js version 8 or 9, then you may encounter debug start failed error
But I need to debug with v.9. Is there any possible ?
You can try IntelliJ WebStorm.