hexo中的那些坑

hexo deploy 部署提示找不到Git

解决方法:在Hexo 3.0版本后deploy git是被分开的,所以需要单独安装,安装命令如下:

1
npm install hexo-deployer-git --save

hexo deploy 部署提示错误如下:

FATAL can not read a block mapping entry; a multiline key may not be an impli key at line 73, column 12:

解决方法:出现类似错误一般是由于_config.yml配置文件中deploy配置项中冒号之后没有添加空格引起的,所以在每个冒号后面加分号,基本可以解决问题,如下所示:

1
2
3
4
deploy:
type: git
repo: git@github.com:wustMeiming/wustMeiming.github.io.git
branch: master

hexo server运行服务器,没有提示错误,但是浏览器无法预览

解决方法:我自己的本身是配置好了的,后来安装了个福昕阅读器,发现没法预览了,其实由于端口占用引起的,FoxitProtect.exe占用了4000端口,所以启动服务的时候换个端口就行了,比如我用的8000端口:

1
hexo server -p 8000