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目录删除就可以了