hexo无法部署到github解决办法

刚才部署hexo的时候,出现了报错:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
bash: /dev/tty: No such device or address
error: failed to execute prompt script (exit code 1)
fatal: could not read Username for 'https://github.com': No error
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
Error: fatal: HttpRequestException encountered.
��������ʱ����
bash: /dev/tty: No such device or address
error: failed to execute prompt script (exit code 1)
fatal: could not read Username for 'https://github.com': No error

at ChildProcess.<anonymous> (D:\hexo\node_modules\hexo-util\lib\spawn.js:37:17)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at ChildProcess.cp.emit (D:\hexo\node_modules\cross-spawn\lib\enoent.js:40:29)
at maybeClose (internal/child_process.js:925:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)

解决办法如下:
修改hexo安装目录下的_config.yml文件,找到Deployment:

1
2
3
4
deploy:
type: git
repo: https://github.com/yourname/yourname.github.io.git
branch: master

将repo修改为:

1
repo: https://{yourname}:{yourpassword}@github.com/{yourname}/{yourname}.github.io.git

亲测可行。

坚持原创技术分享,您的支持将鼓励我继续创作!
0%