Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set Node.js environment variables in WebStorm

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)?

like image 873
Bryan Irace Avatar asked Oct 09 '11 23:10

Bryan Irace


People also ask

How do I set an environment variable in WebStorm?

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: =.

How do I change the run configuration in WebStorm?

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.


2 Answers

It is actually possible Here is the official doc: http://www.jetbrains.com/webstorm/webhelp/run-debug-configuration-node-js.html

Here is my screenshotenter image description here

like image 184
xinbenlv Avatar answered Sep 22 '22 06:09

xinbenlv


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.

like image 43
CrazyCoder Avatar answered Sep 20 '22 06:09

CrazyCoder