安装不稳定导致路径错误



我正试图手动将Husky添加到我的项目中,如下所述:https://typicode.github.io/husky/#/?id=manual

我运行npm install husky --save-dev,然后添加并安装了husky作为一个开发依赖项。然后我尝试运行npx husky install并获得以下输出:

C:UsersLukaProjectszeiterfassungtestneu>npx husky install
npm ERR! code ENOENT
npm ERR! syscall spawn bash
npm ERR! path C:UsersLukaProjectszeiterfassungtestneu
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:UsersLukaAppDataLocalnpm-cache_logs2022-08-21T09_32_56_190Z-debug-0.log

完整的错误日志:https://pastebin.com/ypbMCusx

没有任何东西阻止npm访问项目文件夹,所有其他模块都安装并正常工作。我甚至在另一台笔记本电脑上尝试过,结果都一样,我做错了什么?

解决方案使用Git shell而不是cmd

至于原因,我不确定,我也尝试了管理员模式下的cmd和PowerShell,但都不起作用。

最新更新