Skip to content
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

No such file or directory 2: ./node_modules/pre-commit/hook error when commiting #13738

Closed
k-matti opened this issue Jan 25, 2022 · 6 comments
Closed

Comments

@k-matti
Copy link

k-matti commented Jan 25, 2022

Describe the bug

Can't commit because of " No such file or directory 2: ./node_modules/pre-commit/hook" error everytime

Version & OS

Version 2.9.6 (x64)

Steps to reproduce the behavior

  1. Go to 'Github desktop'
  2. Click on 'Commit'
  3. See error

Screenshots

image

@steveward
Copy link
Member

Thanks for the issue @k-matti. Are you wanting to use a pre-commit hook with this repository? If you don't need the pre-commit hook, you can delete it in your repository by editing the pre-commit file (git/hooks/pre-commit). Some users have also had success gettin hooks to work by following these steps. Let me know if that helps.

For reference we are tracking the option to skip pre-commit hooks in #11626.

@steveward steveward added the more-info-needed The submitter needs to provide more information about the issue label Jan 26, 2022
@k-matti
Copy link
Author

k-matti commented Jan 26, 2022

Hi @steveward I don't want to remove hooks from repo. I just want to use GitHub desktop instead of git from command line where everything works fine.

@no-response no-response bot removed the more-info-needed The submitter needs to provide more information about the issue label Jan 26, 2022
@steveward
Copy link
Member

Try following the solution mentioned here and here of making this change:

npm -> npm.cmd
npx -> npx.cmd

Let us know if that helps.

@steveward steveward added the more-info-needed The submitter needs to provide more information about the issue label Jan 26, 2022
@k-matti
Copy link
Author

k-matti commented Feb 1, 2022

Try following the solution mentioned here and here of making this change:

npm -> npm.cmd
npx -> npx.cmd

Let us know if that helps.

I run these commands in CMD but get still the same error

@no-response no-response bot removed the more-info-needed The submitter needs to provide more information about the issue label Feb 1, 2022
@steveward
Copy link
Member

@k-matti just to clarify -- you need to edit your hooks with that change -- is that what you did?

@steveward steveward added the more-info-needed The submitter needs to provide more information about the issue label Feb 11, 2022
@k-matti
Copy link
Author

k-matti commented Feb 14, 2022

@steveward don't have hooks folder. I switch do sourcetree and everything works fine there

@k-matti k-matti closed this as completed Feb 14, 2022
@no-response no-response bot removed the more-info-needed The submitter needs to provide more information about the issue label Feb 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants