- Install JDK and Eclipse IDE in your windows PC. If you do not know how to do, please read article Beginner’s Guide For Install Jdk(Java Delvelopment Kit) And Eclipse In Windows.
- Now you can see test.js in left project explorer.
3. Setup Debug Runtime Configuration.
- Click Eclipse tool bar Window —> Preferences menu.
- Click Add button to add node.js runtime environment. This need you first install node.js in your PC. You can read 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 maybe through 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 left panel, choose Debug As —> Debug Configurations menu. It will popup a dialog which let you configure debug parameters.
I just test above procedure with Eclipse Neon.3 Release ( 4.6.3 ) and node version 7.10.1. These two component are stable to use.
If you use Node.js version 8 or 9, then you may encounter debug start failed error with 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