vbenjs / vue-vben-admin

A modern vue admin panel built with Vue3, Shadcn UI, Vite, TypeScript, and Monorepo. It's fast!
https://www.vben.pro
MIT License
24.96k stars 6.79k forks source link

git无法提交 #272

Closed irezm closed 3 years ago

irezm commented 3 years ago

image

.
├── .git  -- git 地址文件
├── bill-commons  -- springboot 后端基础组件
├── bill-server  -- springboot 后端服务器
├── webapp
│   └── vue-vben-admin  -- 前端项目
└── zmvn  -- 特殊maven pom文件

首先安装依赖,执行 yarn install 时报错无法找到.git文件夹,通过husky官方文档在 package.json 文件中修改postinstall参数解决无法安装,但是当我通过 git add --all && git commit -m "message" 将代码推送致git仓库时出现一下错误

npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /home/zi/Documents/mycode/bill-management/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/home/zi/Documents/mycode/bill-management/package.json'
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!     /home/zi/.npm/_logs/2021-02-16T10_21_12_456Z-debug.log
husky - pre-commit hook exited with code 254 (error)
anncwb commented 3 years ago

尝试下这个 https://typicode.github.io/husky/#/?id=custom-directory

// package.json
{
  "scripts": {
    "postinstall": "cd .. && husky install front/.husky"
  }
}