搭建Hexo博客在git上执行 hexo d /hexo g 报错:ERROR Local hexo not found in D:\hexo 解决

Hexo搭建博客的时候,已经使用命令在cmd中下载了依赖包,但是执行 hexo d 和hexo g 报错,报错如截图:

ERROR Local hexo not found in D:\hexo

ERROR Try running:'npm install hexo --save'


导致这个原因为在自己的博客文件夹中,.gitignore文件中添加了node_modules/,导致更新的时候,这个文件夹被忽略,没有被更新上去。


解决方案:

    1.cmd进入博客当前文件夹路径

    2.执行 npm install

    3.执行 hexo server

    4.执行成功后,再到博客下的git中执行 hexo d /hexo g 发现可以执行成功。


猜你喜欢

转载自blog.csdn.net/yellowmushroom/article/details/80680022