Reputation: 1875
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)?
Upvotes: 36
Views: 35333
Reputation: 418
I'm new to JetBrains products, i'm not sure if this is the official solution.
Sharing the steps I took resolve this issue.
Note: I'm using NPM package manager.
In WebStorm menu, go to Run -> Edit Configuration -> click + -> npm
then provide the following fields:
Click Ok
Then select the run configuration:
Finally got the nodejs server up and running:
Upvotes: 0
Reputation: 401975
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.
Upvotes: 9
Reputation: 952
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
Upvotes: 51