ITADN

无法提交到git仓库

#3Closedflyrainning 创建于 2023-02-09
F
flyrainningcommented
我的项目git仓库是在`/home/rain/Desktop/test`目录,然后在仓库中建立目录v1/manager,在这个manager目录中使用了fantastic-startkit(从https://gitee.com/hooray/fantastic-startkit.git 中clone然后复制粘贴过来),也就是说fantastic-startkit的package.json位置是在`/home/rain/Desktop/test/v1/manager/package.json` 当我根据文档,将package.json中 `"postinstall": "simple-git-hooks"` 修改成 `"postinstall": "cd ../.. && simple-git-hooks"` 后,执行pnpm install报错 ``` [ERROR], Was not able to set git hooks. Error: Error: ENOENT: no such file or directory, stat '/home/rain/Desktop/test/package.json' ``` 将package.json文件修改回 `"postinstall": "simple-git-hooks"`,执行pnpm install正常通过。提示 ``` [INFO] Successfully set the pre-commit with command: pnpm lint-staged [INFO] Successfully set all git hooks ``` 但是当我执行git commit提交时,产生了下面的错误提示,无法提交 ``` ERR_PNPM_NO_IMPORTER_MANIFEST_FOUND  No package.json (or package.yaml, or package.json5) was found in "/home/rain/Desktop/test". ``` 请问要怎样才能正常commit,谢谢
关闭于 2023-02-13 2 条评论