-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[4.0.0 | Git Bash | Windows 10] stdin is not a tty #627
Comments
Adding |
Thanks again for the report. I've been able to reproduce the first issue by creating a non git project: $ mkdir foo && cd foo
$ npm init -y && npm install husky
# ...
husky > Setting up git hooks
The "path" argument must be of type string. Received type undefined
husky > Failed to install Husky should have displayed a better error message. Running $ mkdir foo && cd foo
$ git init && npm init -y && npm install husky That said, I have trouble reproducing the one with I've tried this in Git Bash on Windows 10: $ mkdir foo && cd foo
$ git --version && npm --version
git version 2.24.1.windows.2
6.13.4
$ git init && npm init -y && npm i husky -D
$ echo '{ "hooks": { "pre-commit": "echo hello && exit 1" } }' > .huskyrc
$ git add .huskyrc && git commit -m foo
husky > pre-commit (node v10.10.0)
hello |
Thanks for investigating. Seems to be an issue pertaining to yarn only (npm works, as you mentioned). Replace Comparing -packageManager=npm
+packageManager=yarn |
Hmm, I've done the previous steps but used yarn |
In real projects, I'm using module.exports = {
hooks: {
'commit-msg': 'commitlint -E HUSKY_GIT_PARAMS',
'pre-commit': 'lint-staged',
},
}; But I reproduced it using your example steps, so { "hooks": { "pre-commit": "echo hello && exit 1" } } |
this is not limited to git bash, this happens in command prompt and powershell. For me I only experienced it on git push |
Hmm, it only happens to me in Git Bash and it's any/all hooks. Works as expected in PS and CMD. |
What's your version of yarn? |
|
|
Seems it's related to eslint in my case:
Seems like you should limit what get's published in your npm package. |
🤷♂ You're sure you don't have |
Good idea. But no, just checked :/ (I don't have a Do you also have this error if you try in a fresh repo with Yarn 2: You just have to run |
Those threads are how I found Interestingly, the error does not occur with yarn v2.0.0-rc.21 (berry). |
Seeing this on
Roleback to 3.1.0 as workaround |
I too saw this on |
for me v4.0.4 still fails and seems to be related to yarn v1.21.1 |
after enough investigating it seems to me that this is bug located inside the I created two PRs, should be noted that the first one is dependent on which version of yarn your using. |
Thanks for the PRs! |
Strange,
|
If I run |
|
ok, this does the trick: if [ -t 1 ]; then
exec < /dev/tty
fi |
what does |
@Casz @wKovacs64 @viceice I'd really like to be able to test locally. Working or reviewing PRs related to stdin error without a reproducible example is quite hard. Would you have any ideas what I could do to have the error in my env? I've installed Git using https://git-scm.com/ with default options (tried to reinstall it also multiple times) and Yarn using |
Found it, installed Yarn using the Windows installer (https://yarnpkg.com/en/docs/install#windows-stable) and it fails with |
I installed git: 2.24.1.windows.2 |
I installed with chocoloately and had the issue. |
Let me add a PR with reproducible tests inside appveyor. :) |
Husky was failing on push due to typicode/husky#627.
Husky was failing on push due to typicode/husky#627.
Husky was failing on push due to typicode/husky#627.
Husky was failing on push due to typicode/husky#627. (cherry picked from commit 3eaa881)
Husky was failing on push due to typicode/husky#627. (cherry picked from commit 3eaa881)
@tobiasweibel Works like a charm! Thank. Just curious though, how is it working? Restarting the PC resets the env and the workaround ceases to work. I guess it's to do with how npx works. |
Same for us, using workarounds mentioned above. |
@jetersen Any timeframe to get this solved? |
I think the problem was fixed already a longer time ago. Just update to the latest 4* version. |
ok, seems to work 😅 will remove the workaround |
I had the same issue with version 3.x but version 4.1.0 has worked for me without needing any workarounds mentioned above. |
thx |
This worked for me. |
Windows 11, bash.
step5: ctrl+x to save |
Still running into this issue on husky 8.0.3 and yarn 1.22.22. Fortunately the above fix in the .huskyrc still fixes it. |
I'm getting the |
for me |
Husky 4.0.0 isn't working in Git Bash for Windows 10, triggering a
stdin is not a tty
error for every git operation that triggers a hook.Versions
OS: Windows 10 1903
Shell: Git Bash (
GNU bash, version 4.4.23(1)-release (x86_64-pc-msys)
)Git:
git 2.24.1.windows.2
HUSKY_DEBUG=1 npm install husky --save-dev
HUSKY_DEBUG=1 git commit
Note: on the fresh test repo, this command worked because the first command failed so the hooks did not install properly. On an existing repo with existing hooks, it looks like this:
The text was updated successfully, but these errors were encountered: