di-sukharev / opencommit

Generate conventional git commit messages with AI in 1 second 🤯🔫
https://www.npmjs.com/package/opencommit
MIT License
6.15k stars 328 forks source link

[Bug]: TTY initialization failed: uv_tty_init returned EINVAL (invalid argument) #202

Open imperugo opened 1 year ago

imperugo commented 1 year ago

Opencommit Version

2.2.10

Node Version

16.16.0

NPM Version

8.11.0

What OS are you seeing the problem on?

Mac

What happened?

Hi, I've just added the prepare-commit-msg hook using husky in order to run oco --no-verify.

unfortunately it doesn't seem to work, I'm getting this error

❯ git commit -m "test"
→ No staged files match any configured task.
┌  open-commit
│
◇  2 staged files:
  .github/workflows/opencommit.yml
  .husky/prepare-commit-msg
│
◇  📝 Commit message generated
│
└  Commit message:
——————————————————
chore: remove OpenCommit Github Action and add Husky prepare-commit-msg hook to run OpenCommit CLI before commit message is created
│
◇  📝 Commit message generated
│
└  ✖ TTY initialization failed: uv_tty_init returned EINVAL (invalid argument)

husky - prepare-commit-msg hook exited with code 1 (error)

Do you have any hint?

Expected Behavior

The it works

Current Behavior

Getting error

Possible Solution

No response

Steps to Reproduce

No response

Relevant log output

No response

github-actions[bot] commented 1 year ago

Stale issue message

stevemao commented 1 year ago

Still a problem

maxbec commented 11 months ago

Any ideas on this? I have the same problem.

scottdotau commented 8 months ago

Are you guys both on Windows? If so try this: https://github.com/typicode/husky/issues/850#issuecomment-774231951

I'm getting this issue in Linux though :(

di-sukharev commented 8 months ago

what are the reproduction steps? how do you add a pre-commit-msg hook via husky? could you share the simplest way for me to reproduce it pls

abidssi commented 6 months ago

I am getting this error, any help would highly be appreciated. Screenshot from 2024-05-02 16-38-03

testeducative commented 6 months ago

I am getting this error, any help would highly be appreciated. Screenshot from 2024-05-02 16-38-03

Try using pnpm i instead.