env: node: no such file or directory when running external tools (solved, but not solved)

On 2017.2, OSX 10.11.16. When I run an external tool, the output panel states:

env: node: no such file or directory
process exited with code 127

However, if I take the EXACT code this ran, and paste it into the terminal, it runs and completes without issue.

I found an article here on Stack Overflow which explained a step which allowed PHPStorm to complete the External Tool w/o need to paste the code into the terminal, but he never went beyond the why's or how's of it. That post is located here:


In short, he states "PHPStorm attempts to run a command to pull the ENV vars out of the OS, but is failing to" Sure enough, when I do what he suggests, running:

open -a ~/Applications/PHPStorm.app

I can run the external tool without issue. So does anyone know what I can do to get PHPStorm to just run the External Tool script without issue?


As you can run your tool when starting PhpStorm in terminal, then it's indeed the issue with retrieving terminal environment when starting from GUI.

Please recreate the issue and provide your idea.log (https://intellij-support.jetbrains.com/hc/en-us/articles/207241085-Locating-IDE-log-files). Don't paste its content here, put it on some file server and provide a link


Not sure how I can "recreate the issue", but here's my log: http://www.aaronmartone.com/idea-log.zip

The issue happens automatically, so I booted the program, ran a script, had it fail, and created the log immediately thereafter.



loading environment from korn shell is not currently supported, please follow https://youtrack.jetbrains.com/issue/WEB-28105 for updates.

So I can only suggest starting PhpStorm from terminal

Some links you may find useful: http://apple.stackexchange.com/questions/106355/setting-the-system-wide-path-environment-variable-in-mavericks, https://devnet.jetbrains.com/docs/DOC-1160#comment-2801, http://apple.stackexchange.com/questions/51677/how-to-set-path-for-finder-launched-applications.. The problem is that the way to define system-wide environment variables on Mac changes from one OS version to another (even minor system updates may break your environment)


What is KORN shell? To my knowledge, I use FISH. Is it the same issue with FISH? Nothing sans the OS' core/default shell is supported as of yet?


WebStorm uses System.getenv("SHELL") to get your default shell; so '/usr/bin/ksh' is your $SHELL environment variable value



When I navigate to `/usr/bin` there is no `ksh` file/folder. (I am viewing all hidden files/folders)

When I open terminal or use terminal in PHPStorm, and type: echo $SHELL, it does report: /usr/bin/ksh.

When I open terminal, goto preferences > general, under SHELLS OPEN WITH, I have: "Command" '/usr/local/bin/fish'

I'll see if there's a way I can get the $SHELL variable to use the shell I want (FISH).



I see, thanks for update:) Setting $SHELL to your actual shell should solve the issue


Please sign in to leave a comment.