hexojs / hexo

A fast, simple & powerful blog framework, powered by Node.js.
https://hexo.io
MIT License
39.21k stars 4.82k forks source link

进行部署时候出现错误,该如何解决? #3043

Closed forget1 closed 6 years ago

forget1 commented 6 years ago

当我使用hexo d进行博客的部署时,控制台出现如图所示的错误,请问这是什么原因导致的呢?我该如何进行解决呢?

JoeJoeyMa commented 6 years ago

请查看在目录内_config.yml文件里的github地址是否填写正确,最好把内文件po出来方便进一步查看是什么问题

forget1 commented 6 years ago

# 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
  auto_detect: false
  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: https://hexo.io/plugins/
## Themes: https://hexo.io/themes/
theme: next

# Deployment
## Docs: https://hexo.io/docs/deployment.html
deploy:
  type: git
  repo: https://github.com/forget1/forget1.github.io.git
  branch: master

search:
  path: search.xml
  filed: post
  format: html
  limit: 10000

live2d:
  model: miku
  bottom: -60

这个是_comfig.yml中的相关代码,GitHub的地址填写没有出现错误。

izaktan commented 6 years ago

最近大家都出现了这个问题,https://superuser.com/questions/1297583/git-push-failing-with-fatal-httprequestexception-encountered 不是电脑或者文件本身的的问题,是Github最近停用了TLS 1.0和v 1.1,文章看这里 解决方案:在这个页面下载最新版Git Credential Manager for Windows

JLHwung commented 6 years ago

可以尝试以下设置:

deploy:
  type: git
  repo: git@github.com:forget1/forget1.github.io.git
  branch: master
izaktan commented 6 years ago

@JLHwung 最好能把这个页面置顶以下什么的,很多人应该都会遇到这个问题

forget1 commented 6 years ago

好的,我试一下

发自我的小米手机在 Huáng Jùnliàng notifications@github.com,2018年2月23日 21:35写道:可以尝试以下设置: deploy: type: git repo: git@github.com:forget1/forget1.github.io.git branch: master

—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or mute the thread.

{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/hexojs/hexo","title":"hexojs/hexo","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/hexojs/hexo"}},"updates":{"snippets":[{"icon":"PERSON","message":"@JLHwung in #3043: 可以尝试以下设置:\r\n\r\ndeploy:\r\n type: git\r\n repo: git@github.com:forget1/forget1.github.io.git\r\n branch: master\r\n"}],"action":{"name":"View Issue","url":"https://github.com/hexojs/hexo/issues/3043#issuecomment-368010294"}}}

vimcaw commented 6 years ago

@JLHwung 改完还是报错

deploy:
  type: git
  repo: git@github.com:vimcaw/blog.git
  branch: master
Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
Error: Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

    at ChildProcess.<anonymous> (C:\Users\vimcaw\Documents\GitHub\blog\node_modules\hexo-util\lib\spawn.js:37:17)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at ChildProcess.cp.emit (C:\Users\vimcaw\Documents\GitHub\blog\node_modules\cross-spawn\lib\enoent.js:40:29)
    at maybeClose (internal/child_process.js:891:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
FATAL Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Error: Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

    at ChildProcess.<anonymous> (C:\Users\vimcaw\Documents\GitHub\blog\node_modules\hexo-util\lib\spawn.js:37:17)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at ChildProcess.cp.emit (C:\Users\vimcaw\Documents\GitHub\blog\node_modules\cross-spawn\lib\enoent.js:40:29)
    at maybeClose (internal/child_process.js:891:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)

Process finished with exit code 2
JLHwung commented 6 years ago

@vimcaw What's the output of

ssh -v git@github.com

? And how github.com is resolved?

nslookup github.com
JLHwung commented 6 years ago

Updated notice on hexo-deployer-git.

breakingcoder commented 6 years ago

you can try command : "git config --global credential.helper wincred" in git bash terminal

cnscorpions commented 6 years ago

resolved problem, thanks

steve-yuan-8276 commented 6 years ago

@xiaotan828 我 也遇到这个问题,请问在mac下如何解决呢?

izaktan commented 6 years ago

@steve-yuan-8276 你可以在这里尝试安装Git Credential Manager for Mac,理论上重新安装最新版git也能解决

yyangMr commented 6 years ago

windows把repo改为git@github.com:forget1/forget1.github.io.git解决了,谢谢

YuanAaron commented 5 years ago

windows10 repo:git@github.com:forget1/forget1.github.io.git,problem solved,thanks!

carol2024666 commented 4 years ago

请问一下各位大佬,为什么把repo那一行改成repo:git@github.com:forget1/forget1.github.io.git就可以了呢?

ligj1706 commented 3 years ago

image

尝试了很多方法仍然无法解决,MAC上大家如何解决的呢?

yiyayamaya commented 3 years ago

windows把repo改为git@github.com:forget1/forget1.github.io.git解决了,谢谢

可用!