0

I am developing a Node.js application in Eclipse Oxygen. This application needs to read environment variables from the underlying OS (Ubuntu) during debugging. Problem is, I have no way to set these variables, except by putting them in my .profile and logging out of the computer and back in or rebooting. As you can imagine, this is a very inefficient way to debug a program. I tried setting the variables in a terminal window and starting Eclipse from the command line there. That works, but is still not a very efficient use of time when environment variable have to change often.

All of the search results for this problem show an Environment tab on the launch configuration, but I don't have that tab for Node.js projects (it's there for Java projects).

How can I set environment variables that can be seen by my Node.js program?

David Powell
  • 537
  • 1
  • 4
  • 16
  • In my understanding, environment variables can only be set before starting a process. For Nodes.js, the process is not a run configuration but the Node.js server. The Node.js server process runs even after terminating a run configuration. To change environment variables you have to shutdown the Node.js server (if it is already running) and restart it with the new environment variables. – howlger Oct 26 '17 at 22:56
  • See also https://stackoverflow.com/q/22312671/6505250 – howlger Oct 26 '17 at 23:02

0 Answers0