Title: Nodeclipse Online Help - Run

Running

Right-click .js file with Node.js app and select "Run As -> Node Application" (similar to Java applications).

Press Ctrl+F11 to run [again].

Running issues

see also Debug page.

Run Configuration

You can configure node and apps parameters workspace wide in Preferences -> Nodeclipse or per file:

Right-click .js file with Node.js app and select "Run As -> Run Configuration..." (Hint: the easiest way to create LaunchConfiguration is actually run the file once.)

You can configure to pass

To have LaunchConfiguration saved within Project folder, select path in Shared File field on Common Tab of LaunchConfiguration. (Yes, dialog string is confusing)

Since Nodeclipse 0.5 it is possible to set environment variables in a launch configuration. The "Environment" tab is not there in the Node launcher.

As an alternative way you can also add another JS file that sets the variables before it calls the node app and run that instead.

e.g.

setTimeout(function(){
  process.env.NODE_ENV="development";
  require("./app.js");
},100);

Warning multiple launch configurations

In Nodeclipse version 0.6 add possibility to run Node.js app with monitor (see Monitor page) or launch coffee util to compile *.coffee files. However these have ran into problem http://stackoverflow.com/questions/19157302/eclipse-plugin-development-saved-launchconfiguration-overrides-launchtype

Restart

Option 1. Right-click on launched application in Debug View and select Terminate and Relaunch.

(In Node perspective Debug View is visible by default)

Option 2 by igor:
  1. Right-click on your project in Project Explorer > Properties > Builders
  2. New... > Program > OK
  3. Name: Terminate existing node.js process(es)
  4. Location: C:\Windows\System32\taskkill.exe (${env_var:SystemRoot}\System32\taskkill.exe did not work for me, it might for you)
  5. Working Directory: Browse Workspace... > select your project > OK
  6. Arguments: /IM node.exe /F
  7. Switch to Build Options tab and tick During auto builds, untick Launch in background > OK
  8. Create another builder: New... > Program > OK
  9. Name: Start <your-project-name>
  10. Location: C:\Program Files\nodejs\node.exe (you can try ${env_var:ProgramFiles}\nodejs\node.exe as well)
  11. Working directory: same as point #5
  12. Arguments: app.js (or any other file for application entry point)
  13. Switch to Build Options tab and tick both During auto builds and Launch in background > OK
  14. Turn on project autobuild: Window > Preferences > General > Workspace, tick Build automatically > OK
  15. Change default build order: Window > Preferences > General > Workspace > Build Order, untick Use default build order and remove all projects except your node.js project > OK
  16. Restart Aptana/Eclipse (There are bugs, so sometimes preference changes are just not saved and get lost. You have to double-check.)
Option 3 #57 running app.js with node-dev, forever, supervisor, nodemon etc

A general approach was selected #57, however as I don't [yet] use any of Node.js module named above, some polishing is needed for this functionality, like #118 The use case "Nodeclipse with nodemon"

Start talking if you care.

Sources

Check LaunchConfigurationDelegate.java for launching Node.js logic.

Contribute

Edit online on GitHub