Node 14 Caused Trouble in Deployment of Hexo

It’s been a long time since I updated my blog on the old Macbook I had. So I am updating it now and found this problem.

Problem

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
34
xiaxii@cecilias-mbp hexo % 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: http://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:1924:10)
at tryCatcher (/Users/xiaxii/Documents/GitHub/hexo/node_modules/bluebird/js/release/util.js:16:23)
at ret (eval at makeNodePromisifiedEval (/Users/xiaxii/.config/yarn/global/node_modules/bluebird/js/release/promisify.js:184:12), <anonymous>:13:39)
at /Users/xiaxii/Documents/GitHub/hexo/node_modules/hexo-deployer-git/node_modules/hexo-fs/lib/fs.js:144:39
at tryCatcher (/Users/xiaxii/Documents/GitHub/hexo/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/Users/xiaxii/Documents/GitHub/hexo/node_modules/bluebird/js/release/promise.js:512:31)
at Promise._settlePromise (/Users/xiaxii/Documents/GitHub/hexo/node_modules/bluebird/js/release/promise.js:569:18)
at Promise._settlePromise0 (/Users/xiaxii/Documents/GitHub/hexo/node_modules/bluebird/js/release/promise.js:614:10)
at Promise._settlePromises (/Users/xiaxii/Documents/GitHub/hexo/node_modules/bluebird/js/release/promise.js:694:18)
at Promise._fulfill (/Users/xiaxii/Documents/GitHub/hexo/node_modules/bluebird/js/release/promise.js:638:18)
at Promise._resolveCallback (/Users/xiaxii/Documents/GitHub/hexo/node_modules/bluebird/js/release/promise.js:432:57)
at Promise._settlePromiseFromHandler (/Users/xiaxii/Documents/GitHub/hexo/node_modules/bluebird/js/release/promise.js:524:17)
at Promise._settlePromise (/Users/xiaxii/Documents/GitHub/hexo/node_modules/bluebird/js/release/promise.js:569:18)
at Promise._settlePromise0 (/Users/xiaxii/Documents/GitHub/hexo/node_modules/bluebird/js/release/promise.js:614:10)
at Promise._settlePromises (/Users/xiaxii/Documents/GitHub/hexo/node_modules/bluebird/js/release/promise.js:694:18)
at Promise._fulfill (/Users/xiaxii/Documents/GitHub/hexo/node_modules/bluebird/js/release/promise.js:638:18)
at Promise._resolveCallback (/Users/xiaxii/Documents/GitHub/hexo/node_modules/bluebird/js/release/promise.js:432:57)
at Promise._settlePromiseFromHandler (/Users/xiaxii/Documents/GitHub/hexo/node_modules/bluebird/js/release/promise.js:524:17)
at Promise._settlePromise (/Users/xiaxii/Documents/GitHub/hexo/node_modules/bluebird/js/release/promise.js:569:18)
at Promise._settlePromise0 (/Users/xiaxii/Documents/GitHub/hexo/node_modules/bluebird/js/release/promise.js:614:10)
at Promise._settlePromises (/Users/xiaxii/Documents/GitHub/hexo/node_modules/bluebird/js/release/promise.js:694:18)
at Promise._fulfill (/Users/xiaxii/Documents/GitHub/hexo/node_modules/bluebird/js/release/promise.js:638:18)
at Promise._resolveCallback (/Users/xiaxii/Documents/GitHub/hexo/node_modules/bluebird/js/release/promise.js:432:57)
at Promise._settlePromiseFromHandler (/Users/xiaxii/Documents/GitHub/hexo/node_modules/bluebird/js/release/promise.js:524:17)
at Promise._settlePromise (/Users/xiaxii/Documents/GitHub/hexo/node_modules/bluebird/js/release/promise.js:569:18)
at Promise._settlePromise0 (/Users/xiaxii/Documents/GitHub/hexo/node_modules/bluebird/js/release/promise.js:614:10)
at Promise._settlePromises (/Users/xiaxii/Documents/GitHub/hexo/node_modules/bluebird/js/release/promise.js:694:18)
at Promise._fulfill (/Users/xiaxii/Documents/GitHub/hexo/node_modules/bluebird/js/release/promise.js:638:18)

Solution 1

The reason the version of Node is to high (14+) in my new Macbook. I need to downgrade it to 12 or 13 in order to render Hexo.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
$ brew uninstall node

$ brew search node
==> Formulae
libbitcoin-node node node-sass node@12 ✔ nodebrew nodenv
llnode node-build node@10 node_exporter nodeenv
==> Casks
nodebox nodeclipse

If you meant "node" specifically:
It was migrated from homebrew/cask to homebrew/core.
$ brew install node@12
...
$ brew link node@12
$ echo "\n" >> ~/.zshrc; export PATH="/usr/local/opt/node@12/bin:$PATH"

Solution 2

  1. Ppgrade hexo by changing the hexo version in package.json
  2. Run npm update in terminal