-
Notifications
You must be signed in to change notification settings - Fork 10.2k
Closed
Description
Describe the bug
I have a .git/hooks/pre-commit which is exactly the following:
#!/bin/sh
npm testWhen I commit via GitHub Desktop, it fails:
/bin/bash: C:/Program Files/nodejs/npm: No such file or directory
It works when committing via git CLI.
Version & OS
Open 'About GitHub Desktop' menu to see the Desktop version. Also include what operating system you are using.
Steps to reproduce the behavior
- Create a hook as
.git/hooks/pre-commit - Commit something
- See error
Expected behavior
It should run the npm command
Actual behavior
It says no such file
Screenshots
Logs
2021-07-09T14:34:12.623Z - info: [ui] [Timing] Action 'create commit' for 'saschanaz/types-web' took 0.292s
2021-07-09T14:35:53.954Z - info: [ui] Executing createCommit: git commit -F - (took 1.372s)
2021-07-09T14:35:53.963Z - error: [ui] `git commit -F -` exited with an unexpected code: 1.
stderr:
/bin/bash: C:/Program Files/nodejs/npm: No such file or directory
Additional context
This had been working but is regressed since a few months ago.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Fields
Give feedbackNo fields configured for issues without a type.
