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主页,欢迎访问

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