It may be that git cannot find node because husky is used. When checking the specification, the executed script cannot find node. The solution: 1. Find the hooks folder in the ".git" directory, and then Rename it; 2. Reinstall the environment.
The operating environment of this tutorial: The operating environment of this tutorial: linux7.3 system, node18.4.0 version, Dell G3 computer.
Why can't git find node?
git cz reports an error that ""node"" cannot be found"
Using git cz reports an error that "node" cannot be found. At the same time, git commit will also report an error. It may be that husky is used to check the specifications. The executed script cannot find node (even if node has been installed correctly and the terminal can be run directly)
Solution 1:
Find the .git directory. Rename the hooks folder. At this time, the script under it will not be run when executing git commit. The error can be solved and git cz is normal. (This approach skips some checks, such as the format specification for git submission. You only need to use cz normally)
Solution 2:
Environment reinstallation Try it.
Recommended learning: "nodejs video tutorial"
The above is the detailed content of Why can't git find node?. For more information, please follow other related articles on the PHP Chinese website!