eclipse-thingweb / eclipse-thingweb/node-wot
Weird Behavior with Husky
- Dominant language
- TypeScript
- Stars
- 192
- Forks
- 100
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 6
Description
While working on #682 which only changes readme files, I had not bothered with running `npm install` or `npm ci` since it wasn't "programming". When I have realized that I should have used `npm run format` after pushing once and seeing the CI errors, I have run `npm install` from memory and `npm format` worked. However, when I wanted to commit and push, I got the following error:
> fatal: cannot run .husky/pre-commit: No such file or directory
When I google this, I don't find satisfying solutions, i.e. they tell me to delete `node_modules` (which did not work) or to ignore it by changing .git configuration or by adding `--no-verify` (this is what I did in the end).
Does anyone know why this happens? I am using WSL on a Windows machine. The workflow I did is the following:
1. Clean clone of node-wot
2. Do a bunch of changes to readmes
3. Commit them with signatures etc.
4. Open Pull Request
5. See CI errors
6. Run `npm install`
7. Run `npm format`
8. Commit changes (only readme.md files)
9. See husky errors (same error for commit or push)
10. Try to solve it
11. Add `--no-verify` to skip the problem and to commit and push
12. CI shows no formatting errors
13. 🥳 (while acknowledging that I did not solve the actual problem)
Contributor guide
Assessment
This issue has not been assessed yet.