[英]npm ERR! husky - .git can't be found WINDOWS
I'm trying to install mattlewis92'sangular 14.0+ calendar , which suggests the use of the command ng add angular-calendar
.我正在尝试安装mattlewis92 的angular 14.0+ calendar ,这表明使用命令ng add angular-calendar
。 However when doing so I got an error:但是,这样做时出现错误:
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c husky install
npm ERR! 'husky' is not recognized as an internal or external command,
npm ERR! operable program or batch file.
I realized that I don't have husky as a dependency so I added it according to husky's docs .我意识到我没有 husky 作为依赖项,所以我根据husky 的文档添加了它。 Unfortunately after installing husky I got a new error:不幸的是,在安装了 husky 之后,我收到了一个新错误:
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c husky install
npm ERR! husky - .git can't be found (see https://typicode.github.io/husky/#/?id=custom-directory)
I followed the suggested link above huksy docs/ Recipes/ Custom directory , but I have no common problem as package.json as well as .git and .husky are all in the same directory level -> in my project's root folder.我按照huksy docs/Recipes/Custom 目录上方的建议链接,但我没有常见问题,因为package.json以及.git都在根文件夹中。目录级别 - > myhusky '
All suggestions are welcome!欢迎所有建议!
You could你可以
This is the accepted node js version found over their website Node.js (>=14.19.0 or >=16.9.0)
这是在他们的网站Node.js (>=14.19.0 or >=16.9.0)
上找到的可接受的节点 js 版本
So if, you do not have those version -> update it.因此,如果您没有这些版本-> 更新它。
You do not want to update your node.js version?您不想更新您的 node.js 版本吗?
Downgrade to the following -> angular-calendar: 0.29.0
降级到以下 -> angular-calendar: 0.29.0
The library cannot install the calendar-utils
.该库无法安装calendar-utils
。
Funnily enough, running npm i angular-calendar
outside an angular project worked just fine有趣的是,在 angular 项目之外运行npm i angular-calendar
工作得很好
So what you can do.所以你能做什么。
npm i angular-utils
somewhere outside an angular project在 angular 项目之外的某个地方运行npm i angular-utils
node_modules
, package.json
& package-lock.json
inside your project将生成的信息node_modules
, package.json
& package-lock.json
到你的项目里面npm i angular-calendar
运行npm i angular-calendar
ng add angular-calendar
should work just fine.然后,如果你, ng add angular-calendar
应该可以正常工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.