Windows 10 - cygpath: command not found
See original GitHub issueDescribe the bug
When attempting to commit or push a branch I am given an error about cygpath not being found.
Git For Windows is installed on my system and running the commands manually in a command prompt works fine. GitHub desktop preferences has the shell set to Command Prompt also which I would have thought would solve the issue, but it does not. Changing it to Git Bash also does not appear to have any effect.
Version & OS
Version 2.5.7 Windows 10 Pro - 10.0.18363 Build 18363
Steps to reproduce the behavior
- Make a commit on a project that uses pre-commit hooks using husky.
- Observe the error message
OR
- Create a branch on a project that uses pre-commit hooks using husky
- Push the branch
- Observe the error message
Expected behavior
Should commit and run the pre-commit hooks.
Actual behavior
Throws the following error;
/c/dev/work/SomeProject/node_modules/.bin/npm: line 5: cygpath: command not found
internal/modules/cjs/loader.js:985
throw err;
^
Error: Cannot find module 'C:\npm\bin\npm-cli.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:982:15)
at Function.Module._load (internal/modules/cjs/loader.js:864:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
at internal/main/run_main_module.js:18:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
error: failed to push some refs to 'https://github.com/SomeUser/SomeProject.git'
Logs
2020-11-09T11:33:23.145Z - info: [ui] Executing createCommit: git commit -F - (took 1.401s)
2020-11-09T11:33:23.149Z - error: [ui] `git commit -F -` exited with an unexpected code: 1.
stderr:
husky > pre-commit (node v12.16.1)
/c/dev/work/SomeProject/node_modules/.bin/lint-staged: line 5: cygpath: command not found
internal/modules/cjs/loader.js:985
throw err;
^
Error: Cannot find module 'C:\lint-staged\bin\lint-staged.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:982:15)
at Function.Module._load (internal/modules/cjs/loader.js:864:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
at internal/main/run_main_module.js:18:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:14 (2 by maintainers)
Top Results From Across the Web
Running sh script gives command not found for any unix/linux ...
The first invocation of bash must be a login shell. If not the enviroment is incorretly set. E:\cygwin64>bin\bash.exe bash: arch: command ...
Read more >Problem building webkit on Windows 10: sh: cygpath
CMake Error: The source directory "C:/cygwin64/Release" does not appear to contain CMakeLists.txt. Specify --help for usage, or press the help button on the ......
Read more >Windows 10 install problem. Path issue? - Neuron.yale.edu
So I'm installing NEURON 7.6.5 under Windows 10 and everything seemed to ... bash: cygpath: command not found bash: nrnpyenv.sh: command not ...
Read more >Missing cygpath.exe in git - Visual Studio Feedback
The missing cygpath.exe is causing the hook to fail, which lets the commit fail. I'm not sure when the issue starts, but my...
Read more >Command not found by Cygwin make - IBM
Resolving The Problem · Go to Start > Settings > Control Panel · Select System · Go to the Advanced tab · Select...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I fixed this by installing the latest Git for Windows, then copying
C:\Program Files\Git\usr\bin\cygpath.exeto%HOMEPATH%\AppData\Local\GitHubDesktop\app-2.9.0\resources\app\git\usr\bin.Not elegant, but it showed only one command was missing.
@pmachapman Thanks, that worked perfectly!