Skip to content

Pre-commit hooks fail due to missing dependencies if npm install has not been run #14609

@aka1976mb

Description

@aka1976mb

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:

  1. Make a change to a file.
  2. Stage the file.
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions