针对github权限导致hexo部署失败的解决方案
hexo deplay出错,没有反应
今天想在自己的另一个博客地址(链接地址)上更新一下博客,没想到hexo deplay没有反应,以下是解决过程:(更新于 2016-12-24 11:17:43)
1、因为没有报错信息,所以直接在网上搜解决方案,集广大网友们的智慧,然后使用了npm install hexo-deployer-git --save,而后hexo deploy,但是没有解决问题,而且爆出警告:
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.0.15
2、更新npm npm install npm -g ,更新成功
3、继续npm install hexo-deployer-git --save,hexo deploy 还是不行:
INFO Deploying: git
INFO Clearing .deploy_git folder...
INFO Copying files from public folder...
fatal: Not a git repository (or any of the parent directories): .git
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
Error: fatal: Not a git repository (or any of the parent directories): .git
at ChildProcess.<anonymous> (E:\blog\HexoBlog\node_modules\hexo-util\lib\spawn.js:37:17)
at emitTwo (events.js:87:13)
……
(E:\blog\HexoBlog\node_modules\cross-spawn\lib\enoent.js:40:29)
at maybeClose (internal/child_process.js:827:16)
at Socket.<anonymous> (internal/child_process.js:319:11)
at emitOne (events.js:77:13)
at Socket.emit (events.js:169:7)
at Pipe._onclose (net.js:477:12)
4、后来灵机一动,把.deploy_git文件夹手动删除了,重新hexo deploy了一次,成功!
问题描述:
如题,hexo最后一次部署是在8月份,然后就是秋招,一直没有在hexo博客上上传新博文,等回过头打算整理几篇博客上传,发现一直部署失败,通过搜索网上前辈们的经验,我决定重新使用hexo+github pages搭建博客(顺便更新版本了),然而······并没有什么卵用······
错误依旧如下(这已经是重复设置SSH key后的错误版本啦,与一开始的错误描述略有不同,不过都是github权限问题):
Permission denied (publickey).
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: Warning: Permanently added 'github.com,192.30.253.112' (RSA) to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
at ChildProcess.<anonymous> (E:\blog\HexoBlog\node_modules\hexo-util\lib\spawn.js:37:17)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at ChildProcess.cp.emit (E:\blog\HexoBlog\node_modules\cross-spawn\lib\enoent.js:40:29)
at maybeClose (internal/child_process.js:827:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
FATAL Warning: Permanently added 'github.com,192.30.253.112' (RSA) to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Error: Warning: Permanently added 'github.com,192.30.253.112' (RSA) to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
at ChildProcess.<anonymous> (E:\blog\HexoBlog\node_modules\hexo-util\lib\spawn.js:37:17)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at ChildProcess.cp.emit (E:\blog\HexoBlog\node_modules\cross-spawn\lib\enoent.js:40:29)
at maybeClose (internal/child_process.js:827:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
之前的错误,有网友们有建议将deploy处设置不要使用https,而是改为SSH,如下:
repository: https://github.com/username/username.github.io.git
修改为
repo:git@github.com:username/username.github.io.git
修改了很多遍,以各种姿势······然而还是没有什么卵用
当然错误不是重点,重点是怎样使我们的博客可以重新部署到github上~
当部署失败的时候,请按照以下步骤进行:
(当然,在此之前,你可以选择 hexo init)教程有很多,一搜就可以,懒癌症可以点击传送门,这是一个比较全的搭建配置教程。
(1)检查是否有SSH key
登陆github,点击头像位置处 Settings ——> SSH and GPG keys ,查看是否有SSH keys。如果有,直接跳到第(3)步;如果没有,则继续。
(2)新建 SSH key,在git shell(或者git bash等命令窗口),注意大小写:
$ ssh-keygen -t rsa -C "邮箱名"
然后会出现:
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/dell/.ssh/id_rsa):
直接回车就可以。
然后会出现:
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
要求你输入密码,这个密码会在你提交项目时使用,如果为空的话提交项目时则不用输入。这个设置是防止别人往你的项目里提交内容。
注意:输入密码的时候没有*字样的,直接输入就好。
然后会出现:
Your identification has been saved in /c/Users/dell/.ssh/id_rsa.
Your public key has been saved in /c/Users/dell/.ssh/id_rsa.pub.
The key fingerprint is:
65:69:······02:4b emailname@email.com
The key's randomart image is:
+--[ RSA 2048]----+
| |
| . o . |
| . o o = o |
| . o * = o |
| E o + o . |
| . o. . . |
| .. |
+-----------------+
至此,密钥已经成功生成。
(3)接下来在github上添加SSH key:
① 打开本地文件:id_rsa.pub(文件路径可以在上一步SSH生成成功后看到路径,比如我的是c/Users/dell/.ssh/id_rsa.pub),可以将这个文件在编辑器中打开,然后全选复制。
② 登陆github,点击头像位置处 Settings ——> SSH and GPG keys ——> New SSH key,点击新建SSH key。
③ 将 ① 中复制的内容粘贴在key文本框里,title可以不用填(或者自己起一个名字也可以)。
(4)测试设置是否成功:
$ ssh -T git@github.com
有可能会出现:
The authenticity of host 'github.com (192.30.252.1)' can't be established.
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)?
或者是
The authenticity of host 'github.com (192.30.252.1)' can't be established.
RSA key fingerprint is nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)?
这种情况下,直接 yes 回车
然后会出现(也可能在 ++$ ssh -T git@github.com++ 之后,直接出现的就是这个,我就是这样~):
Hi username! You've successfully authenticated, but GitHub does not
provide shell access.
(5)设置用户信息:
$ git config --global user.name "用户名"
$ git config --global user.email "你希望的邮箱名"
(6)然后就可以部署你的博客到github啦~
$ hexo g
$ hexo d
(7)更多常见hexo命令,传送门
补充1:过程中也遇到一些其他问题,比如Error: Bad file number,但是总的来说,按照上面的步骤就可以解决因为github权限问题hexo部署失败的问题(前提是你的配置文件的内容没有问题)。
补充2:windows系统不要使用它自己的命令窗口!!!使用git shell或者 git bash 等之类的一些工具。
引用借鉴:
本文链接:http://www.cnblogs.com/xsilence/p/6001938.html
针对github权限导致hexo部署失败的解决方案的更多相关文章
- hexo部署失败如何解决
- 解决nginx启动时域名解析失败而导致服务启动失败的问题
问题: nginx启动或者reload的时候,会对proxy_pass后面的域名进行DNS解析,如果解析失败,启动就会失败或者reload失败. 我们是to B的产品,客户的环境可能是不通公网的,因此 ...
- 使用 GitHub Actions 实现 Hexo 博客自动部署
一.Hexo 相关知识点 静态博客简单,但是发布博文时稍显麻烦,一般需要下面两步: hexo clean hexo g -d // 相当于 hexo g + hexo d 如果考虑到同步源文件,还需要 ...
- hexo部署到github时,提示typeError [ERR_INVALID_ARG_TYPE] The “mode“ argument must be integer. Receive
hexo部署到github时,提示typeError [ERR_INVALID_ARG_TYPE]: The "mode" argument must be integer. Re ...
- 手把手教从零开始在GitHub上使用Hexo搭建博客教程(四)-使用Travis自动部署Hexo(2)
前言 前面一篇文章介绍了Travis自动部署Hexo的常规使用教程,也是个人比较推荐的方法. 前文最后也提到了在Windows系统中可能会有一些小问题,为了在Windows系统中也可以实现使用Trav ...
- 手把手教从零开始在GitHub上使用Hexo搭建博客教程(三)-使用Travis自动部署Hexo(1)
前言 前面两篇文章介绍了在github上使用hexo搭建博客的基本环境和hexo相关参数设置等. 基于目前,博客基本上是可以完美运行了. 但是,有一点是不太好,就是源码同步问题,如果在不同的电脑上写文 ...
- Hexo - 记录一次Pages服务部署失败的原因
问题与分析 某天忽然发现,一直运行得好好的Pages服务部署失败了,GitHub Pages报错如下: Your site is having problems building: The tag c ...
- 用nodejs安装hexo,将hexo部署到github
跌跌撞撞写这篇博文,希望下一篇可以好点 运行环境:最新版本的nodejs + git 安装好nodejs 和 git ,注册好github账号,新建仓库****.github.io(****为gith ...
- hexo部署github和gitment操作简单介绍
优点: 快速高效 支持markdown 布局自定义简单,无广告 部署简单 因为想开始写博客,但又找不到好的博客平台,平时都看博客园和开源中国看博客文章,但博客园的那个皮肤是真有点难受,所以就想自己打个 ...
随机推荐
- 速战速决 (5) - PHP: 动态地创建属性和方法, 对象的复制, 对象的比较, 加载指定的文件, 自动加载类文件, 命名空间
[源码下载] 速战速决 (5) - PHP: 动态地创建属性和方法, 对象的复制, 对象的比较, 加载指定的文件, 自动加载类文件, 命名空间 作者:webabcd 介绍速战速决 之 PHP 动态地创 ...
- c++函数模板作为类的成员函数,编译报错LNK2019的解决方法
为了使某个类的成员函数能对不同的参数进行相同的处理,需要用到函数模板,即template<typename T> void Function(). 编译时报错LNK2019 解决方法: 1 ...
- Lind.DDD.ExpressionExtensions动态构建表达式树,实现对数据集的权限控制
回到目录 Lind.DDD框架里提出了对数据集的控制,某些权限的用户为某些表添加某些数据集的权限,具体实现是在一张表中存储用户ID,表名,检索字段,检索值和检索操作符,然后用户登陆后,通过自己权限来构 ...
- http cancelled状态与ajax 超时
在最近一周,我们的前端在测试某些批量超过的某个步骤时,发现请求好像发出来,但是后台状态没有变化,说是最近才出现的问题,以前一直都是正常的,两天连续出现两次之后,来找笔者,首先检查了下中间件的日志,发现 ...
- [翻译]用 Puppet 搭建易管理的服务器基础架构(2)
我通过伯乐在线翻译了一个Puppet简明教程,一共分为四部分,这是第二部分. 原文地址:http://blog.jobbole.com/87680/ 本文由 伯乐在线 - Wing 翻译,黄利民 校稿 ...
- Dog_Hybird的诞生
起因 开玩笑说“iOS搞不动了”,另外一方面iOS组的哥哥们给力,少一个我也妥妥的.又听闻web前端组来了一个不得了的人物,“老司机,带带我”这种机会不能错过,1个多月前就申请转web前端了.开始是苦 ...
- 使用 Jquery-UI 实现一次拖拽多个选中的元素操作
项目需要,实现一个拖放操作,要求每次可以拖拽选中的多个元素,释放到目标容器后可排序.考虑了一下,觉得jquery-ui比较合适,毕竟它提供了项目需要的交互性事件机制.拖拽.释放.排序.选择等效果.而在 ...
- SharePoint 2013 使用JavaScript对象模型配置智能提示
前言 默认在VS2012/2013中编写SharePoint JavaScript 客户端对象模型,都没有智能感知的功能,用起来非常麻烦:其实,我们可以手动配置一下,让JavaScript可以进行智能 ...
- Thrift-java学习小结
➠更多技术干货请戳:听云博客 Thrift是什么?什么情况下使用thrift Thrift源于大名鼎鼎的facebook之手,在2007年facebook提交Apache基金会将Thrift作为一个开 ...
- Dagger2 (一) 入坑篇
为什么是Dagger2 为了更好的了解Dagger2,请先阅读RoboGuice篇了解依赖注入. 官方文档称,依赖注入这种技术已经在存在多年了,为什么Dagger2要造轮子? Dagger2是第一个全 ...