Accessing the Windows environment variables within External Tools

I'm attempting to setup a Grunt task within the External Tools and keep getting an error that "grunt" is an invalid filename.  It works fine in any DOS prompt and works just fine from within the WS Terminal as well.

But when I try this as an External Tool, it always fails due to the path environment variable not (apparently) being set.  

Any suggestions on how I can get this to work with the environment variables?  I'd really rather not have to specify a full path/etc to each tool I want to use when it's already setup in the Windows PATH environment variable.


Comment actions Permalink

I was able to get Grunt working thanks to this Stackoverflow post:

However, I'd still like to be able to get the Windows environment variables to work within the External Tools.  

Thanks again!

Comment actions Permalink

Hi there,

When did you installed grunt (or whatever other command that does not work for you)? Have you restarted computer since then?

Windows attaches copy of current environment to the app when it starts .. so if you make changes in PATH (or whatever) outside of IDE, these changes will not propagate to IDE until restarted.

Also: please show screenshot of your External Tools entry.

When executing anything via External Tools, you should provide exact file name. For example: if you have some bat/cmd file (e.g. lessc.cmd), you have to provide full file name ("lessc.cmd") and not just "lessc". When you executing this in terminal, Windows shell (yes -- cmd.exe) searches for such exact name and if not found then searches for lessc.exe,, lessc.cmd and so on in your PATH. But when process is launched via External Tools Windows executes command as is. This one should be exact (like 99.999% IMO) reason for your "that "grunt" is an invalid filename" message.


Please sign in to leave a comment.