hexo icon indicating copy to clipboard operation
hexo copied to clipboard

升级到hexo 3.0后deploy type: github选项无效

Open Xuanwo opened this issue 11 years ago • 42 comments

必须要将config.yml中的github修改为git才能正常deploy。 这个不算BUG,无伤大雅,在wiki里面提一句就好,除了修改type之外别的不需要修改。

Xuanwo avatar Jan 26 '15 13:01 Xuanwo

请问怎么升级到 3.0

mingmings avatar Jan 29 '15 08:01 mingmings

同问,怎么升级, npm 上还是 2.8.3 的

mingming-killer avatar Jan 29 '15 08:01 mingming-killer

$ npm install hexo@beta -g

https://github.com/hexojs/hexo/wiki/Migrating-from-2.x-to-3.0

tommy351 avatar Jan 29 '15 09:01 tommy351

原来 wiki 上有,多谢,以后有事先去 wiki 上瞄一下

mingming-killer avatar Jan 29 '15 09:01 mingming-killer

  • _config.yml 文件:
deploy:
  type: git
  repo: [email protected]:wanggnim/Gnim.git
  branch: gh-pages
  • node_modules文件夹:
2015/06/11  10:15    <DIR>          .
2015/06/11  10:15    <DIR>          ..
2015/06/10  21:47    <DIR>          .bin
2015/06/10  21:47    <DIR>          hexo
2015/06/11  10:15    <DIR>          hexo-deployer-git
2015/06/10  21:47    <DIR>          hexo-generator-archive
2015/06/10  21:47    <DIR>          hexo-generator-category
2015/06/10  21:47    <DIR>          hexo-generator-index
2015/06/10  21:47    <DIR>          hexo-generator-tag
2015/06/10  21:47    <DIR>          hexo-renderer-ejs
2015/06/10  21:47    <DIR>          hexo-renderer-marked
2015/06/10  21:47    <DIR>          hexo-renderer-stylus
2015/06/10  21:47    <DIR>          hexo-server
               0 File(s)              0 bytes
              13 Dir(s)  119,912,251,392 bytes free
  • 然后执行:hexo deploy
  • 提示:ERROR Deployer not found: git

这是为什么

ghost avatar Jun 12 '15 09:06 ghost

npm install hexo-deployer-git --save 目测你是把那个--save漏掉了。

Xuanwo avatar Jun 12 '15 09:06 Xuanwo

我的hexo-deployer-git已经安装了,不过我又执行了一遍npm install hexo-deployer-git --save.

但是node_modules目录没有发生变化

2015/06/11  10:15    <DIR>          .
2015/06/11  10:15    <DIR>          ..
2015/06/10  21:47    <DIR>          .bin
2015/06/10  21:47    <DIR>          hexo
2015/06/11  10:15    <DIR>          hexo-deployer-git
2015/06/10  21:47    <DIR>          hexo-generator-archive
2015/06/10  21:47    <DIR>          hexo-generator-category
2015/06/10  21:47    <DIR>          hexo-generator-index
2015/06/10  21:47    <DIR>          hexo-generator-tag
2015/06/10  21:47    <DIR>          hexo-renderer-ejs
2015/06/10  21:47    <DIR>          hexo-renderer-marked
2015/06/10  21:47    <DIR>          hexo-renderer-stylus
2015/06/10  21:47    <DIR>          hexo-server
               0 File(s)              0 bytes
              13 Dir(s)  119,912,251,392 bytes free

而且我在安装npm install hexo-deployer-git --save的时候遇到了

hexonpm ERR! Windows_NT 6.1.7601
npm ERR! argv "D:\\Program Files\\nodejs\\\\node.exe" "D:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "hexo-deployer-git" "--save"
npm ERR! node v0.12.2
npm ERR! npm  v2.7.4
npm ERR! code EIO
npm ERR! errno EIO
npm ERR! syscall write

npm ERR! write EIO
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     D:\gitrep\gnim\branches\hexo\npm-debug.log

的问题,我安装所有的node模块都会遇到这个问题,但是hexo generate和hexo server可以正常使用,

执行

D:\gitrep\branches\hexo>hexo deploy
ERROR Deployer not found: git

还是不成功

ghost avatar Jun 12 '15 10:06 ghost

换个文件夹重新hexo init,试试呢?

Xuanwo avatar Jun 12 '15 10:06 Xuanwo

仍然不行

ghost avatar Jun 12 '15 10:06 ghost

我之前之所以提出要进行npm install hexo-deployer-git --save,是因为我看过了你的package.json,发现里面并没有注册hexo-deployer-git的相关信息。所以判断你之前安装hexo-deployer-git的时候并不是使用--save参数安装的。

所以,我觉得可以尝试一下npm uninsatll hexo-depolyer-git,再执行npm install hexo-deployer-git --save。如果还是不行,只能重装nodejs环境试试了。

Xuanwo avatar Jun 12 '15 10:06 Xuanwo

我的操作步骤

hexo init
npm install hexo --save
hexo g
npm install
npm install hexo-deployer-git --save
hexo g
hexo d

_config.yml

deploy:
  type: git
  message: "g"
  repo: 
    github: [email protected]:wanggnim/Gnim.git,gh-pages

ghost avatar Jun 12 '15 10:06 ghost

在使用npm安装的时候,总是报错

D:\tmp\hexo1>npm install hexo-deployer-git --save
-/-|-|||-\/--\\|/\|/--\\|/|/--\|/-|--\\|\\\|/-|\\|//-|/--\/|\|--\-\|-\|\\|-|-\|/-\/|npm WARN optional dep failed, continuing [email protected]
/-\|/-\\|/|/-\|/|\|/hexonpm ERR! Windows_NT 6.1.7601
npm ERR! argv "D:\\Program Files\\nodejs\\\\node.exe" "D:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "hexo-deployer-git" "--save"
npm ERR! node v0.12.2
npm ERR! npm  v2.7.4
npm ERR! code EIO
npm ERR! errno EIO
npm ERR! syscall write

npm ERR! write EIO
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     D:\tmp\hexo1\npm-debug.log

我也有见其他朋友提到过这个问题,是node.js的问题吗

ghost avatar Jun 12 '15 10:06 ghost

是不是还需要io.js啊

ghost avatar Jun 12 '15 10:06 ghost

http://stackoverflow.com/questions/17035399/why-this-error-happend-nodejs-error-write-eio

Thus your problem could very well be related to the encoding your environment is in.

看起来是编码问题,你检查看看。

Xuanwo avatar Jun 12 '15 11:06 Xuanwo

ok,我去看看,谢谢你

ghost avatar Jun 12 '15 11:06 ghost

除此以外,还有可能是权限问题,你用管理员模式试试看?

参考:https://cnodejs.org/topic/521c7a50bee8d3cb12b4bfec

Xuanwo avatar Jun 12 '15 11:06 Xuanwo

用管理员不行,我回家换个系统,不用windows试试看

ghost avatar Jun 12 '15 11:06 ghost

我觉得这个去npm那边交issue可能更有帮助些

Xuanwo avatar Jun 12 '15 11:06 Xuanwo

hexo deploy的时候可以选择不删除远程仓库的原来文件吗?

ghost avatar Jun 12 '15 14:06 ghost

不可以,因为每次都是git push --force

Xuanwo avatar Jun 12 '15 14:06 Xuanwo