When trying to commit changes, the pre-commit hooks may fail with errors like "'prettier' is not recognized as an internal or external command". This happens if npm install hasn't been run recently.
To reproduce:
- Make a change to a file.
- Stage the file.
- Attempt to commit the file.
The pre-commit hooks will fail.
Running npm install resolves the issue by installing the necessary dependencies for the hooks.
We should consider ways to prevent this, such as:
- Ensuring the
pre-commit script checks for dependencies and provides a clearer error message.
- Adding a check in the development setup documentation to emphasize running
npm install.