Hexo: 请教解决方法

Created on 9 May 2015  ·  16Comments  ·  Source: hexojs/hexo

# hexo d -g                         
You should configure deployment settings in _config.yml first!

Available deployer plugins:
  git

For more help, you can check the online docs: http://hexo.io/


# hexo g
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
TypeError: Cannot read property 'enable' of null
    at Promise.then.then.then.cache.length (/home/node_modules/hexo/lib/hexo/post.js:301:26)
    at tryCatcher (/home/node_modules/hexo/node_modules/bluebird/js/main/util.js:24:31)
    at Promise._settlePromiseFromHandler (/home/node_modules/hexo/node_modules/bluebird/js/main/promise.js:454:31)
    at Promise._settlePromiseAt (/home/node_modules/hexo/node_modules/bluebird/js/main/promise.js:530:18)
    at Async._drainQueue (/home/node_modules/hexo/node_modules/bluebird/js/main/async.js:182:12)
    at Async._drainQueues (/home/node_modules/hexo/node_modules/bluebird/js/main/async.js:187:10)
    at Async.drainQueues (/home/node_modules/hexo/node_modules/bluebird/js/main/async.js:15:14)
    at process._tickCallback (node.js:415:13)

Most helpful comment

比如说,你deploy后面的三个参数,应该这样:

deploy:
  type: git   
  repository: https://github.com/tongxindao/tongxindao.github.io.git
  branch: master

变量名之前两个空格,参数值前一个空格,用:分割

All 16 comments

第一个问题,你需要npm install hexo-deployer-git --save
第二个问题,不是很清楚,你把config.yml内容贴出来看看

# Hexo Configuration
## Docs: http://hexo.io/docs/configuration.html
## Source: https://github.com/hexojs/hexo/

# Site
title: dreamer's blog
subtitle:  
description:  
author:  tony
language: zh-CN
timezone:

# Header
menu:
  主页: /
  所有文章: /archives
  # 随笔: /tags/随笔

#Feed Atom
feed:
  type: atom
  path: atom.xml
  limit: 20

#sitemap
sitemap:
  path: sitemap.xml

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

# Directory
source_dir: source
public_dir: public
tag_dir: tags
archive_dir: archives
category_dir: categories
code_dir: downloads/code
i18n_dir: :lang
skip_render:

# Writing
new_post_name: :title.md # File name of new posts
default_layout: post
titlecase: false # Transform title into titlecase
external_link: true # Open external links in new tab
filename_case: 0
render_drafts: false
post_asset_folder: false
relative_link: false
future: true
highlight:
enable: true
line_number: true
tab_replace:

# Category & Tag
default_category: uncategorized
category_map:
tag_map:

# Date / Time format
## Hexo uses Moment.js to parse and display date
## You can customize the date format as defined in
## http://momentjs.com/docs/#/displaying/format/
date_format: YYYY-MM-DD
time_format: HH:mm:ss

# Pagination
## Set per_page to 0 to disable pagination
per_page: 10
pagination_dir: page

# Extensions
## Plugins: http://hexo.io/plugins/
## Themes: http://hexo.io/themes/
theme: yilia

# Deployment
## Docs: http://hexo.io/docs/deployment.html
deploy:
type: git   
repository: https://github.com/tongxindao/tongxindao.github.io.git
branch: master

yml格式要求严格,:之后只能有一个空格。

比如说,你deploy后面的三个参数,应该这样:

deploy:
  type: git   
  repository: https://github.com/tongxindao/tongxindao.github.io.git
  branch: master

变量名之前两个空格,参数值前一个空格,用:分割

deploy:
type: git
branch: [master]
repo: https://github.com/tongxindao/tongxindao.github.io.git

@zairl23 你想表达什么?

兄弟 你解决这个问题了吗?感觉我的config好像没有什么格式问题啊,让迩并没有什么卵用,唉

deploy后面的每一行都要缩进的啊

Please open new issue if problem persists.

谢谢Xuanwo,我是config格式问题,现在问题解决了!

确实是每一个 :的后面需要也只能有一个在半角情况下敲进去的空格

我猜你没有安装npm install hexo-deployer-git --save

I changed "repo: " to "repository: "then deploy success. the document write
repo: <repository url>
is the doc wrong?

@herosgame I'm using repo and works well.

site下的title 和subtitle设置为中文,乱码

比如说,你deploy后面的三个参数,应该这样:

deploy:
  type: git   
  repository: https://github.com/tongxindao/tongxindao.github.io.git
  branch: master

变量名之前两个空格,参数值前一个空格,用:分割

正解

Was this page helpful?
0 / 5 - 0 ratings

Related issues

netcan picture netcan  ·  3Comments

mashirozx picture mashirozx  ·  3Comments

hgDendi picture hgDendi  ·  3Comments

demurgos picture demurgos  ·  3Comments

leoli-dev picture leoli-dev  ·  3Comments