Everduin94 / better-commits

A CLI for creating better commits following the conventional commits specification
MIT License
1.88k stars 69 forks source link

Issue: Something went wrong when committing: Error: spawnSync /bin/sh ENOENT #91

Closed apmolenaar closed 3 months ago

apmolenaar commented 3 months ago

image

I have the following error: Something went wrong when committing: Error: spawnSync /bin/sh ENOENT. I'm using Git Bash on a Windows 11 machine. Initiated the prompt with npx better-commits. Is there something I could do to fix this issue?

This error looks like a cwd error with bin/sh but when I use the command /bin/sh -c ls bash could find the sh executable.

apmolenaar commented 3 months ago

Already fixed the issue by overriding the shell.

{
  "overrides": {
     "shell": "/bin/sh"
  }
}

to

{
  "overrides": {
     "shell": "c:\\Program Files\\Git\\bin\\bash.exe"
  }
}

Is also mentioned at the bottom of the README.md file. Best to keep this issue present for people encountering the same error.

Thanks for the great tool!