hexo 部署中的几个坑

1. 大小写导致hexo页面访问404

可以参考这篇文章https://blog.csdn.net/liuergo/article/details/102640098

我之前进入标签界面会出现404,发现url中是tags,本地文件夹也是tags,查看了下git仓库里,文件夹确实莫名其妙变成了Tags。因此导致了404.简单的处理办法就是进入blog/.deploy_git/.git/ 修改config中的配置,将ignorecase = true 改为 ignorecase = false。忽略大小写。然后执行即可。

1
2
3
hexo clean
hexo g
hexo d

2.node.js版本问题,导致hexo d失败

报错差不多如下(我的报错没了,这是网上找的别人的报错)

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
INFO  Start processing
INFO Files loaded in 94 ms
INFO 0 files generated in 22 ms
INFO Deploying: git
INFO Clearing .deploy_git folder...
INFO Copying files from public folder...
FATAL Something's wrong. Maybe you can find the solution here: https://hexo.io/docs/troubleshooting.html
TypeError [ERR_INVALID_ARG_TYPE]: The "mode" argument must be integer. Received an instance of Object
at copyFile (fs.js:1890:10)
at tryCatcher (D:\Blog\node_modules\bluebird\js\release\util.js:16:23)
at ret (eval at makeNodePromisifiedEval (D:\Node\node_global\node_modules\hexo-cli\node_modules\bluebird\js\release\promisify.js:184:12), <anonymous>:13:39)
at D:\Blog\node_modules\hexo-fs\lib\fs.js:144:39
at tryCatcher (D:\Blog\node_modules\bluebird\js\release\util.js:16:23)
at Promise._settlePromiseFromHandler (D:\Blog\node_modules\bluebird\js\release\promise.js:547:31)
at Promise._settlePromise (D:\Blog\node_modules\bluebird\js\release\promise.js:604:18)
at Promise._settlePromise0 (D:\Blog\node_modules\bluebird\js\release\promise.js:649:10)
at Promise._settlePromises (D:\Blog\node_modules\bluebird\js\release\promise.js:729:18)
at Promise._fulfill (D:\Blog\node_modules\bluebird\js\release\promise.js:673:18)
at Promise._resolveCallback (D:\Blog\node_modules\bluebird\js\release\promise.js:466:57)
at Promise._settlePromiseFromHandler (D:\Blog\node_modules\bluebird\js\release\promise.js:559:17)
at Promise._settlePromise (D:\Blog\node_modules\bluebird\js\release\promise.js:604:18)
at Promise._settlePromise0 (D:\Blog\node_modules\bluebird\js\release\promise.js:649:10)
at Promise._settlePromises (D:\Blog\node_modules\bluebird\js\release\promise.js:729:18)
at Promise._fulfill (D:\Blog\node_modules\bluebird\js\release\promise.js:673:18)
at Promise._resolveCallback (D:\Blog\node_modules\bluebird\js\release\promise.js:466:57)
at Promise._settlePromiseFromHandler (D:\Blog\node_modules\bluebird\js\release\promise.js:559:17)
at Promise._settlePromise (D:\Blog\node_modules\bluebird\js\release\promise.js:604:18)
at Promise._settlePromise0 (D:\Blog\node_modules\bluebird\js\release\promise.js:649:10)
at Promise._settlePromises (D:\Blog\node_modules\bluebird\js\release\promise.js:729:18)
at Promise._fulfill (D:\Blog\node_modules\bluebird\js\release\promise.js:673:18)

解决办法:这是由于node.js版本过高导致的,我当时安装的是最新版16.0版本,在https://nodejs.org/dist/v12.10.0/下载安装了一个12.10的版本后hexo d就执行成功了。