博客更新小记

前言

两年没更新博客了,今天一次性更新发现都更新换代了笑死,我的ssh key都过期了,node与hexo版本都不兼容了。

更新完了再回过来看,感慨我原来才写了这么几篇呀,经历了疫情、毕业、再到开学成为研究生,心路历程可能也一直在变化吧,有很多东西都没有记录到,以后争取多记录点,但估计也是隔一段时间一起更新这样,谁知道呢。到时再说吧哈哈哈

下面要开始记录一些报错及解决方案了

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
GlarcydeMacBook-Pro:blog glarcy$ hexo d
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 (node:fs:2774:10)
at tryCatcher (/Users/glarcy/Documents/blog/node_modules/bluebird/js/release/util.js:16:23)
at ret (eval at makeNodePromisifiedEval (/usr/local/lib/node_modules/hexo/node_modules/bluebird/js/release/promisify.js:184:12), <anonymous>:13:39)
at /Users/glarcy/Documents/blog/node_modules/hexo-deployer-git/node_modules/hexo-fs/lib/fs.js:144:39
at tryCatcher (/Users/glarcy/Documents/blog/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/Users/glarcy/Documents/blog/node_modules/bluebird/js/release/promise.js:517:31)
at Promise._settlePromise (/Users/glarcy/Documents/blog/node_modules/bluebird/js/release/promise.js:574:18)
at Promise._settlePromise0 (/Users/glarcy/Documents/blog/node_modules/bluebird/js/release/promise.js:619:10)
at Promise._settlePromises (/Users/glarcy/Documents/blog/node_modules/bluebird/js/release/promise.js:699:18)
at Promise._fulfill (/Users/glarcy/Documents/blog/node_modules/bluebird/js/release/promise.js:643:18)
at Promise._resolveCallback (/Users/glarcy/Documents/blog/node_modules/bluebird/js/release/promise.js:437:57)
at Promise._settlePromiseFromHandler (/Users/glarcy/Documents/blog/node_modules/bluebird/js/release/promise.js:529:17)
at Promise._settlePromise (/Users/glarcy/Documents/blog/node_modules/bluebird/js/release/promise.js:574:18)
at Promise._settlePromise0 (/Users/glarcy/Documents/blog/node_modules/bluebird/js/release/promise.js:619:10)
at Promise._settlePromises (/Users/glarcy/Documents/blog/node_modules/bluebird/js/release/promise.js:699:18)
at Promise._fulfill (/Users/glarcy/Documents/blog/node_modules/bluebird/js/release/promise.js:643:18)
at Promise._resolveCallback (/Users/glarcy/Documents/blog/node_modules/bluebird/js/release/promise.js:437:57)
at Promise._settlePromiseFromHandler (/Users/glarcy/Documents/blog/node_modules/bluebird/js/release/promise.js:529:17)
at Promise._settlePromise (/Users/glarcy/Documents/blog/node_modules/bluebird/js/release/promise.js:574:18)
at Promise._settlePromise0 (/Users/glarcy/Documents/blog/node_modules/bluebird/js/release/promise.js:619:10)
at Promise._settlePromises (/Users/glarcy/Documents/blog/node_modules/bluebird/js/release/promise.js:699:18)
at Promise._fulfill (/Users/glarcy/Documents/blog/node_modules/bluebird/js/release/promise.js:643:18)

百度了说是node版本太高,与hexo不兼容

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
GlarcydeMacBook-Pro:blog glarcy$ hexo -v
hexo: 3.9.0
hexo-cli: 2.0.0
os: Darwin 21.4.0 darwin x64
node: 16.10.0
v8: 9.3.345.19-node.14
uv: 1.42.0
zlib: 1.2.11
brotli: 1.0.9
ares: 1.17.2
modules: 93
nghttp2: 1.45.1
napi: 8
llhttp: 6.0.2
openssl: 1.1.1l
cldr: 39.0
icu: 69.1
tz: 2021a
unicode: 13.0

回退node

1
2
3
npm install n -g
sudo n 13.0.0
node -v

再次更新hexo d

1
2
3
4
5
6
7
8
9
git@github.com: Permission denied (publickey).
fatal: 无法读取远程仓库。

请确认您有正确的访问权限并且仓库存在。
FATAL Something's wrong. Maybe you can find the solution here: https://hexo.io/docs/troubleshooting.html
Error: Spawn failed
at ChildProcess.<anonymous> (/Users/glarcy/Documents/blog/node_modules/hexo-deployer-git/node_modules/hexo-util/lib/spawn.js:51:21)
at ChildProcess.emit (events.js:210:5)
at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)

去看了一下github,发现ssh key已经不在了哈哈,重新配置

重新生成ssh key

1
ssh-keygen -t rsa -C "你的email地址"

查看公钥,并复制

1
cat ~/.ssh/id_rsa.pub

去github,右上角点击头像–setting–左边栏SSH and GPG keys–new SSH key,title随便填,把公钥复制到key的那个框框,然后add

回到终端

1
2
3
4
5
6
7
8
GlarcydeMacBook-Pro:blog glarcy$ ssh -T git@github.com
GlarcydeMacBook-Pro:blog glarcy$ hexo d
INFO Deploying: git
INFO Clearing .deploy_git folder...
INFO Copying files from public folder...
INFO Copying files from extend dirs...
位于分支 master
无文件要提交,干净的工作区

再次提交,显示无文件要提交,干净的工作区

1
2
3
hexo clean
hexo g
hexo d