Select shell for Run/Debug Configurations
On Windows 10 with Bash on Ubuntu on Windows enabled I am capable of changing the Terminal in IntelliJ IDEA to bash.exe but my run/debug configuration (e.g. an npm script) still runs form cmd.exe. Is there a way of selecting the shell for Run/Debug Configurations?
Please sign in to leave a comment.
WebStorm doesn't use any shells to run Node, it's being run directly. So NPM and Node.js run/debug configurations don't allow configuring the shell.
If your npm scripts run correctly from the bash shell only, try to configure "Node.js interpreter" so that it points to a wrapper script that runs node.js interpreter under the hood. It can be a shell script that starts bash and then calls node.js interpreter, passing parameters to it...
e.g. for git-bash:
where
bash-node.shis:Hey, thanks for the reply.
I tried just that:
But I'm getting
what about renaming git-bash.sh to git-bash.cmd?
I can't suggest exact scripts for your environment, I don't have Ubuntu on Windows
There is something really weird about the default shell:
`echo %PATH%` shows `c:\windows\system32` in path but `where bash` says "INFO: Could not find files for the given pattern(s)."
When executing bash it says
'"C:\Windows\System32\bash.exe"' is not recognized as an internal or external command,
operable program or batch file.
what shell do you run these commands in?
The native shell in IntelliJ I guess?
All I did was use npm run/debug configuration on one of the scripts from package.json (run start) and click play.
>The native shell in IntelliJ I guess?
it doesn't have any native shells
>All I did was use npm run/debug configuration on one of the scripts from package.json (run start) and click play.
do you really run `where bash` and `echo %PATH%` as npm scripts, via run configuration?
Whatever is used to run the commands of the run/debug configuration.
Yes, I made a `.cmd` file like this:
when I create similar script and set it as Node.js interpreter in Node.js run configuration, I get the expected output:
"C:\JetBrains\WebStorm 173.2290.2\bin\runnerw.exe" C:\JetBrains\git-bash-node.cmd C:\WebstormProjects\untitled1\app.js
C:\Program Files\Git\usr\bin\bash.exe
C:\Program Files\Git\usr\bin\bash.exe
i.e. both `where` commands are successfully executed
For select shell for Run/Debug use:
Example: