Git插件報錯,Appears to be a git repo or submodule

Hexo博客需要引入第三方插件,不少包作者誤把包項目得.git文件上傳到github,或者在插件的github路徑下直接下載插件文件夾,結果是插件內含有.git文件,導致下載別的npm包時報錯npm err:

報錯信息如下:

$ npm install hexo-generator-index-pin-top --save                                            npm ERR! path D:\GitHub\AomanHao.github.io\node_modules\hexo-symbols-count-time
npm ERR! code EISGIT
npm ERR! git D:\GitHub\AomanHao.github.io\node_modules\hexo-symbols-count-time: Appears to be a git repo or submodule.
npm ERR! git     D:\GitHub\AomanHao.github.io\node_modules\hexo-symbols-count-time
npm ERR! git Refusing to remove it. Update manually,
npm ERR! git or move it out of the way first.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\10143\AppData\Roaming\npm-cache\_logs\2019-11-22T12_30_49_238Z-debug.log

解決方式:

進入到報錯的node_modules\hexo-symbols-count-time目錄去把.git目錄刪除就可以了


我的個人博客主頁,歡迎訪問

我的CSDN主頁,歡迎訪問

我的GitHub主頁,歡迎訪問

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章