“husky install“ command already exists in prepare script, skipping./Users/982471938qq.com/Desktop

 我们在终端敲自动配置命令时 npx husky-init && npm install

会出现以下报错信息我们预期是敲上面的文件跟根目录会多出 .husky 文件夹

"husky install" command already exists in prepare script, skipping.
/Users/982471938qq.com/Desktop/superSmall/shop-cms/node_modules/husky-init/node_modules/husky/lib/index.js:22
        throw new Error(`.git can't be found (see ${url})`);
        ^

Error: .git can't be found (see https://typicode.github.io/husky/#/?id=custom-directory)
    at install (/Users/982471938qq.com/Desktop/superSmall/shop-cms/node_modules/husky-init/node_modules/husky/lib/index.js:22:15)
    at Object.<anonymous> (/Users/982471938qq.com/Desktop/superSmall/shop-cms/node_modules/husky-init/lib/bin.js:16:21)

 解决方案:

1.首先检查是否有 .git   对git做一个初始化操作

git init

2.最后在输入这个命令

npx husky-init

3.husky 文件就创建成功了

 

 

  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值