How to set shell for npm run-scripts in Windows
npm, shell, windows
Solution
Since npm 5.1
npm config set script-shell "C:\\Program Files (x86)\\git\\bin\\bash.exe"
or (64bit installation)
npm config set script-shell "C:\\Program Files\\git\\bin\\bash.exe"
Note that you need to have git for windows installed.
You can revert it by running:
npm config delete script-shell
Problem
I'm running npm on Windows and would like to use & style parallel operations in run-scripts but running in parallel in cmd is kind of messy in my package.json file I'd like to write- ``` scripts: { "go": "cmd1 & cmd2"} ``` but npm executes the script under cmd.exe which does not know about `;` I could change this to scripts: `{ "go": "bats/bat1.bat")` where bat1.bat is a cmd bat file that uses the windows style call or start commands to run commands in parallel. which works but gives me a script that only works on Windows. It would be a lot simpler if I could get npm to run the script under a bash clone or cygwin. I tried `config: { "shell": "bash"}` but that still ran cmd.exe Is there any way to tell npm to run-scripts using a specific shell (not cmd.exe)?