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目錄刪除就可以了