OS environment variables not loaded for "external tool"

I'm sure this has been asked, there's a lot of noise on similar topics when I search.
I'm trying to run some node commands (in my immediate case "phonegap serve") and WebStorm is balking on the command.

     Cannot run program "phonegap" (in directory "C:\......"): CreateProcess error=2, The system cannot find the file specified

The "phonegap" command is included in my environment variables' PATH along with other tools. I don't want to just use the absolute path to "phonegap.exe" because everything else it depends on such as cordova.exe et al needs to be in the path as well. And before we get into phonegap support etc, this is a broader issue that I've had to deal with for other non-nodeJS tools as well.

How do I include the OS environment variables in the "External tools" feature?

Using Windows 7 x64 and WebStorm 9.0.3 which is based on IntelliJ IDEA.

6 comments
Comment actions Permalink

External tools should be aware of the OS environment variables by default. The problem seems to be elsewhere.

Can you post the full idea.log with the error?

Do you run .exe or .cmd file?

0
Comment actions Permalink

serge wrote:

Do you run .exe or .cmd file?



That's a good question. I was running "phonegap" as the command, not "phonegap.cmd". Adding ".cmd", it seems to work. I'm not sure why this didn't "just work", i.e. why WS didn't invoke it through the OS's shell which would resolve the .cmd. But thanks.

0
Comment actions Permalink

Java execiton API doesn't invoke cmd.exe shell  by default, so the file path must be explicit.

0
Comment actions Permalink

I meant the Win32 shell, not cmd.exe shell. Win32 would surely resolve the .cmd I'm certain by executing it with the "default program" for ".cmd" given a list of "defaultable executables", namely ".exe", ".bat", ".cmd", etc.

0
Comment actions Permalink

serge wrote:

... so the file path must be explicit.


I think you meant to say "the full file name with its extension must be explicit". The path is encapsulated by the PATH variable, as per the OP.

0

Please sign in to leave a comment.