2018年5月6日 星期日

[Hexo] Blog 在 hexo deploy 時發生錯誤

剛剛要發新文章的時候,
執行 hexo deploy ,突然就拋出以下 Exception

錯誤發生到解決

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
The file will have its original line endings in your working directory.
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': Invalid argument
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': Invalid argument
at ChildProcess.<anonymous> (D:\nodejs\test\node_modules\hexo-deployer-git\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 (D:\nodejs\test\node_modules\hexo-deployer-git\node_modules\hexo-util\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 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': Invalid argument
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': Invalid argument
at ChildProcess.<anonymous> (D:\nodejs\test\node_modules\hexo-deployer-git\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 (D:\nodejs\test\node_modules\hexo-deployer-git\node_modules\hexo-util\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)
直接到 _config.yml 檔案裡

原本的設定:

1
2
3
4
deploy:
type: git
branch: master

修改後的設定:

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

參考連結


沒有留言:

張貼留言