Hexo Deploy 失敗!?

TypeError [ERR_INVALID_ARG_TYPE]: The “mode” argument must be integer. Received an instance of Object


Hexo deploy 失敗

今天一如往常修改了一些 blog 內容後準備發布,發現怎麼遲遲未更新,回去看 terminal 才發現這個錯誤。

TypeError [ERR_INVALID_ARG_TYPE]: The "mode" argument must be integer. Received an instance of Object

完整資訊如下:

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
上略
~
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: http://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)
* (HEAD detached at FETCH_HEAD)
master
...skipping...
at tryCatcher (/Users/mingyi/Documents/blog/node_modules/bluebird/js/release/util.js:16:23)
at ret (eval at makeNodePromisifiedEval (/usr/local/lib/node_modules/hexo-cli/node_modules/bluebird/js/release/promisify.js:184:12), <anonymous>:13:39)
at /Users/mingyi/Documents/blog/node_modules/hexo-fs/lib/fs.js:181:12
at tryCatcher (/Users/mingyi/Documents/blog/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/Users/mingyi/Documents/blog/node_modules/bluebird/js/release/promise.js:512:31)
at Promise._settlePromise (/Users/mingyi/Documents/blog/node_modules/bluebird/js/release/promise.js:569:18)
at Promise._settlePromise0 (/Users/mingyi/Documents/blog/node_modules/bluebird/js/release/promise.js:614:10)
at Promise._settlePromises (/Users/mingyi/Documents/blog/node_modules/bluebird/js/release/promise.js:694:18)
at Promise._fulfill (/Users/mingyi/Documents/blog/node_modules/bluebird/js/release/promise.js:638:18)
at Promise._resolveCallback (/Users/mingyi/Documents/blog/node_modules/bluebird/js/release/promise.js:432:57)
at Promise._settlePromiseFromHandler (/Users/mingyi/Documents/blog/node_modules/bluebird/js/release/promise.js:524:17)
at Promise._settlePromise (/Users/mingyi/Documents/blog/node_modules/bluebird/js/release/promise.js:569:18)
at Promise._settlePromise0 (/Users/mingyi/Documents/blog/node_modules/bluebird/js/release/promise.js:614:10)
at Promise._settlePromises (/Users/mingyi/Documents/blog/node_modules/bluebird/js/release/promise.js:694:18)
at Promise._fulfill (/Users/mingyi/Documents/blog/node_modules/bluebird/js/release/promise.js:638:18)
at Promise._resolveCallback (/Users/mingyi/Documents/blog/node_modules/bluebird/js/release/promise.js:432:57)
at Promise._settlePromiseFromHandler (/Users/mingyi/Documents/blog/node_modules/bluebird/js/release/promise.js:524:17)
at Promise._settlePromise (/Users/mingyi/Documents/blog/node_modules/bluebird/js/release/promise.js:569:18)
at Promise._settlePromise0 (/Users/mingyi/Documents/blog/node_modules/bluebird/js/release/promise.js:614:10)
at Promise._settlePromises (/Users/mingyi/Documents/blog/node_modules/bluebird/js/release/promise.js:694:18)
at Promise._fulfill (/Users/mingyi/Documents/blog/node_modules/bluebird/js/release/promise.js:638:18)

之後才熊熊想到 nodeJS 版本升級了,上網一查果然沒錯!!

1
2
3
4
➜  source git:(master) ✗ hexo -v
hexo: 3.8.0
hexo-cli: 1.1.0
os: Darwin 20.6.0 darwin x64

我升級的是 nodeJS 17.2 版本,目前 hexo 並不支援啊~~
要使用 nvm 來降版本,降到 nodeJS 13 版本之後就能順利部署了!!

點我查看 nvm 安裝步驟

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
➜  source git:(master) ✗ nvm use 13
N/A: version "13 -> N/A" is not yet installed.

You need to run "nvm install 13" to install it before using it.
➜ source git:(master) ✗ nvm install 13
Downloading and installing node v13.14.0...
Downloading https://nodejs.org/dist/v13.14.0/node-v13.14.0-darwin-x64.tar.xz...
########################################################################################################################################################################### 100.0%
Computing checksum with shasum -a 256
Checksums matched!
Now using node v13.14.0 (npm v6.14.4)
Creating default alias: default -> 13 (-> v13.14.0)

➜ source git:(master) ✗ node -v
v13.14.0

➜ source git:(master) ✗ hdeploy
上略
~
INFO Deploying: git
INFO Clearing .deploy_git folder...
INFO Copying files from public folder...
INFO Copying files from extend dirs...
[master 4c56324b] Site updated: 2021-12-09 22:27:46
270 files changed, 12371 insertions(+), 5926 deletions(-)
create mode 100644 archives/2021/12/index.html
create mode 100644 post/0.html
Branch 'master' set up to track remote branch 'master' from 'https://github.com/myctw/myctw.github.io'.
INFO Deploy done: git
INFO Deleted database.
INFO Deleted public folder.

這樣就大功告成囉!

  • 作者: MingYi Chou
  • 版權聲明: 轉載不用問,但請註明出處!本網誌均採用 BY-NC-SA 許可協議。