Answer the question
In order to leave comments, you need to log in
Why doesn't the script work when run via npm script?
Please tell me, I really want to solve the problem - I don’t understand why a script launched directly in bash works fine, but if it is written in scripts npm, then when it starts it does not understand anything as if. PS This is on MacOs everything works this way and that, on Windows there is such garbage:
...
"scripts": {
"setFile": "FILE=./swagger/email.yaml; name=$(basename ${FILE%.*}); echo $FILE, $name;"
},
...
Answer the question
In order to leave comments, you need to log in
Decision!
Indeed, npm calls its cmd or powershell scripts to execute, but bash is needed - for this we run the command to change the launch environment
npm config set script-shell "C:\\Program Files\\git\\bin\\bash.exe"
npm config delete script-shell
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question