我正在尝试手动将Husky添加到我的项目中,如下所述:https://typicode.github.io/husky/#/?id=manual
我运行npm install husky --save-dev,husky被添加并安装为开发依赖项,就像它应该的那样。然后我尝试运行npx husky install并获得以下输出:
C:\Users\Luka\Projects\zeiterfassung\testneu>npx husky install
npm ERR! code ENOENT
npm ERR! syscall spawn bash
npm ERR! path C:\Users\Luka\Projects\zeiterfassung\testneu
npm ERR! errno -4058
npm ERR! enoent spawn bash ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Luka\AppData\Local\npm-cache\_logs\2022-08-21T09_32_56_190Z-debug-0.log完整错误日志:https://pastebin.com/ypbMCusx
没有什么能阻止npm访问项目文件夹,所有其他模块都安装并正常工作。我甚至在另一台笔记本上尝试了这个,得到了同样的结果,我做错了什么?
发布于 2022-08-21 13:50:25
解决方案是使用Git shell而不是cmd.。
至于原因,我不确定,我也尝试了管理员模式和PowerShell的cmd,但都不起作用。
https://stackoverflow.com/questions/73433228
复制相似问题