美文网首页
hexo 报错 Cannot read property 

hexo 报错 Cannot read property 

作者: 我的名字叫浩仔 | 来源:发表于2017-03-23 10:08 被阅读2845次

开始折腾静态博客,想把网址 https://itcuihao.github.io/itcuihao 换成 https://itcuihao.github.io
于是把原来的 repository name 由 itcuihao 改为 itcuihao.github.io

hexo配置文件进行相应的修改

deploy:
  type: git
  repo: https://github.com/itcuihao/itcuihao.github.io.git
  branch: master

执行命令

hexo g -d

就报错了:

FATAL Cannot read property 'replace' of null

解决:

看帖子都是说 _config.yml 配置文件中的url 设置错误

我的设置:

# URL
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
url: https://itcuihao.github.io
root: 
permalink: :year/:month/:day/:title/
permalink_defaults:

想了下url应该没有错,那会不会是root设置有问题,于是改成

# URL
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
url: https://itcuihao.github.io
root: itcuihao.github.io
permalink: :year/:month/:day/:title/
permalink_defaults:

执行 hexo g -d 成功。

参考链接

hexo issues #2006
hexo issues #2141
cd2want

相关文章

网友评论

      本文标题:hexo 报错 Cannot read property 

      本文链接:https://www.haomeiwen.com/subject/uohznttx.html