3

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.

1 Answer 1

2

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.