If you like using Eclipse as your preferred IDE for your coding, there is an easy way to use the built in External tools feature in Eclipse to launch Node.js applications, without having to install any external plugins.
Here is a short guide how.
Creating the External tool launcher
To launch this, we need to create a custom External tool launch configuration. Start by opening up your External tool configurations.
This can by done by going Run - External Tools - External Tools Configurations..., or by clicking on the External tools shortcut in the toolbar:
Select Program and then click on the New launch configuration button:
Once the configuration window opens, do the following:
- Select a name for your run configuration, for example "node.js - Hello World".
- Location should point towards node.js launch command, for Window-users this can point directly to node.exe.
- Working Directory should points towards your project. This can be done by clicking on the Browse Workspace... button.
- Apply and close the window.
Running your application
Your launch configuration is now ready to be called from the External tool button:
Running it will use the console view in Eclipse for the output:
Old comments from Disqus
Paul_Verest, Thursday, February 27, 2014 3:44 AM
It is nice DIY solution. Please be aware Nodeclipse Eclipse plugin http://www.nodeclipse.org/
Dennis, Friday, August 2, 2013 5:00 PM
I know this post is a year old now, but I found it very helpful. I was wondering, if you are familiar with doing custom run configurations for node frameworks that have their own way of launching the server. For example, I am using locomotivejs and the launch is thus: $ lcm server. I have been trying to configure eclipse to debug for locomotive but with no luck. Hoping you might be able to point me in the right direction.
Paul_Verest, Thursday, February 27, 2014 3:46 AM
I have not used
lcm. If it Node.js script, it should be debuggable, however if you start debugging from the first line, you will need to step through all
lcmcode or set breakpoints