Issue
I'm trying to set the default shell of npm on windows to bash so that it would recognise directories such as ../hello-backend etc...
I'm getting this weird error after setting it with npm config set script-shell "C:\\Program Files\\git\\bin\\bash.exe"
and whenever I use npm start:
/usr/bin/bash: C:Users***~1AppDataLocalTempstart-******5629763.sh: command not found
(asterisk used to blur out potential sensitive info)
Any answers are appreciated. Thanks.
Solution
I've figured it out, the reason why is because from npm 8.13 version onwards the script name can't have colon (:) in it e.g. (I've adapted the use of shx as it also wasn't working in the same manner as my issue described above)
"scripts": {
"builduiexercise:try": "shx rm -rf build"
}
it was being used as the grouping-convention before but there's a bug as of version v8.13.0 which prevented it from working https://github.com/npm/cli/issues/5066
this was fixed in a later version of the npm v8.13.2 and it shouldn't cause an issue when you update to the latest version of npm as of this post v8.15.0
Answered By - Tony Answer Checked By - Cary Denson (WPSolving Admin)