1 | initial version |
This error occurs when the directory containing the "pre-commit" command is not included in the system's PATH environment variable. To fix this, you will need to add the directory path to your PATH variable.
$ which pre-commit
This will give you the full path to the pre-commit command.
$ nano ~/.bash_profile
If the file does not exist, create it using:
$ touch ~/.bash_profile
export PATH="$PATH:[path/to/]"
For example, if the pre-commit command is located in the directory "/usr/local/bin/", the line would be:
export PATH="$PATH:/usr/local/bin/"
Save and close the file.
Reload the Bash configuration by executing:
$ source ~/.bash_profile
Now, you should be able to run the "pre-commit" command without any issues.