-->

nodejs Eclipse debugger: how to specify arguments?

2020-02-15 06:31发布

问题:

I need to launch the Eclipse nodejs debugger with the specification of an argument. Launching the nodejs application from the commmand line is done as follows:

node myApp.js argumentValue

The value of the argument is then accessible inside the app by using the following:

process.argv[1]

I don't know how to add the argument value when launching the application through Eclipse debugger.

回答1:

I found the solution to be the modification of my nodejs app debug configuration. In Eclipse choose from the menu Run>Debug Configurations then choose the application script under the Node Application block, you should see:

Now select the Arguments tab:

Insert the value of the argument and press Apply.