解决 npm install 时出现的.git can‘t be found (see https://git.io/Jc3F9)的问题 run `npm fund` for details问题解决
目錄
- 復(fù)現(xiàn)問題
- 分析問題
- 分析錯誤日志文件
- 分析index.js文件
- 解決問題
😐 我的博客,不僅幫你解決此類問題,還會告訴如何去分析定位問題。
復(fù)現(xiàn)問題
今天使用webStorm打開ant design pro項目,執(zhí)行如下命令時:
npm install卻報出如下錯誤:
.git can't be found (see https://git.io/Jc3F9) npm ERR! code 1 npm ERR! path D:\project\1myProject\superjson\superjsonweb\web npm ERR! command failed npm ERR! command C:\Windows\system32\cmd.exe /d /s /c husky installnpm ERR! A complete log of this run can be found in: npm ERR! C:\Users\zxy\AppData\Local\npm-cache\_logs\2022-08-05T01_54_02_117Z-debug-0.log根據(jù)其錯誤信息A complete log of this run can be found in:可知,完整的執(zhí)行日志可以在如是文件中找到C:\Users\zxy\AppData\Local\npm-cache\_logs\2022-08-05T01_54_02_117Z-debug-0.log。
分析問題
分析錯誤日志文件
我們打開上述日志文件,找到報錯的對應(yīng)行信息,如下圖所示:
分析index.js文件
在node_modules目錄下的index.js文件中的第63行報出的錯誤信息,如下圖所示:
然而,這里只是報錯信息,并不能解決我們實際的問題,于是繼續(xù)分析這張圖片:
找到紅色框上方的兩行語句,如下所示:
> ant-design-pro@6.0.0-beta.1 prepare > husky install發(fā)現(xiàn)是安裝husky出現(xiàn)了問題。
解決問題
我們打開package.json 文件,找到husky install指令,或者搜索prepare也可以定位到husky install指令,如下圖所示:
使用如下命令,替換husky install:
"prepare": "cd .. && husky install superjsonweb/.husky",如下圖所示:
重新執(zhí)行指令npm install,便沒有報出錯誤了,如下圖所示:
但是,報出了如下提示:
231 packages are looking for fundingrun `npm fund` for details那么,這是什么樣的提示呢?我會在下篇文檔中說到。
總結(jié)
以上是生活随笔為你收集整理的解决 npm install 时出现的.git can‘t be found (see https://git.io/Jc3F9)的问题 run `npm fund` for details问题解决的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 那些曾让你哭过的事,总有一天会笑着说出来
- 下一篇: TP6 TP5 Db‘ not foun