Is there any way to set environment variables when running a Node.js app using JetBrains' official Node plugin for WebStorm (and their other IDEs as well)?
Add environment variablesFrom the main menu, select Run | Edit Configurations or choose Edit Configurations from the run/debug configurations selector on the toolbar. In the Run/Debug Configurations dialog, select a configuration you want to add the environment variables to. Type the variable name and value: =.
Add Run/Debug configurations to the Services windowSelect View | Tool Windows | Services from the main menu or press Alt+8 . In the Services tool window, click Add service, then select Run Configuration Type. Select a run/debug configuration type from the list to add all configurations of this type to the window.
It is actually possible Here is the official doc: http://www.jetbrains.com/webstorm/webhelp/run-debug-configuration-node-js.html
Here is my screenshot
No, it's not possible from WebStorm, environment variables should be defined in your system.
UPDATE: in the new versions it's possible to set environment variables in the Run/Debug configuration.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With