0%

【hexo】【问题】The mode argument must be integer. Received an instance of Object

运行之后

1
hexo clean && hexo deploy

之后出现的问题

The mode argument must be integer. Received an instance of Object

image-20220209145022563

网上说Hexo -v查看一下Hexo的版本

因为node.js和hexo存在版本适配的关系,所以当可能是一个版本过高一个版本过低导致的出现问题。

解决这个问题可以将hexo更新至高版本,也可以重新安装一个低版本的node。

hexo升级

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
hexo -v

hexo: 3.8.0
hexo-cli: 4.3.0
os: win32 10.0.19043
node: 16.13.2
v8: 9.4.146.24-node.14
uv: 1.42.0
zlib: 1.2.11
brotli: 1.0.9
ares: 1.18.1
modules: 93
nghttp2: 1.45.1
napi: 8
llhttp: 6.0.4
openssl: 1.1.1l+quic
cldr: 39.0
icu: 69.1
tz: 2021a
unicode: 13.0
ngtcp2: 0.1.0-DEV
nghttp3: 0.1.0-DEV

全局升级hexo-cli,先hexo version查看当前版本,然后npm install -g hexo-cli,再次hexo version查看是否升级成功。如果hexo不能直接识别运行,改为npx hexo。

使用npm-check,检查系统中的插件是否有升级的。

使用npm-upgrade,升级系统中的相关插件。

npm update -g,检查升级npm本身。

  1. 全局升级 hexo-cli

    1
    npm install hexo-cli -g
  2. 检查系统中的插件是否有升级的,可以看到自己前面都安装了那些插件

    1
    2
    npm install -g npm-check
    npm-check
  3. 升级系统中的插件

    1
    2
    npm install -g npm-upgrade
    npm-upgrade
  4. 更新全局包

    1
    npm update -g
  5. 更新生产环境依赖包

    1
    npm update --save
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
npm install -g hexo-cli #全局升级hexo
hexo version //查看当前版本,判断是否需要升级

npm install -g npm-check //安装npm-check
npm-check //查看系统插件是否需要升级

npm install -g npm-upgrade //安装npm-upgrade
npm-upgrade //更新package.json
//在执行npm-upgrade命令后会要求输入yes或者no,直接输入Yes或Y即可
npm update -g //更新全局插件
npm install -g npm //更新系统插件

hexo clean #清理hexo数据并重新生成页面并部署
hexo g -s
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
hexo                      😎  MAJOR UP  Major update available. https://hexo.io/
npm install --save hexo@6.0.0 to go from 3.8.0 to 6.0.0
😕 NOTUSED? Still using hexo?
Depcheck did not find code similar to require('hexo') or import from 'hexo'.
Check your code before removing as depcheck isn't able to foresee all ways dependencies can be used.
Use --skip-unused to skip this check.
To remove this package: npm uninstall --save hexo

hexo-algolia 😟 MISSING! Not installed.
😕 NOTUSED? Still using hexo-algolia?
Depcheck did not find code similar to require('hexo-algolia') or import from 'hexo-algolia'.
Check your code before removing as depcheck isn't able to foresee all ways dependencies can be used.
Use --skip-unused to skip this check.
To remove this package: npm uninstall --save hexo-algolia

hexo-deployer-git 😎 MAJOR UP Major update available. https://hexo.io/
npm install --save hexo-deployer-git@3.0.0 to go from 0.3.1 to 3.0.0
😕 NOTUSED? Still using hexo-deployer-git?
Depcheck did not find code similar to require('hexo-deployer-git') or import from 'hexo-deployer-git'.
Check your code before removing as depcheck isn't able to foresee all ways dependencies can be used.
Use --skip-unused to skip this check.
To remove this package: npm uninstall --save hexo-deployer-git

hexo-generator-archive 😎 MAJOR UP Major update available. http://hexo.io/
npm install --save hexo-generator-archive@1.0.0 to go from 0.1.5 to 1.0.0
😕 NOTUSED? Still using hexo-generator-archive?
Depcheck did not find code similar to require('hexo-generator-archive') or import from 'hexo-generator-archive'.
Check your code before removing as depcheck isn't able to foresee all ways dependencies can be used.
Use --skip-unused to skip this check.
To remove this package: npm uninstall --save hexo-generator-archive

hexo-generator-category 😎 MAJOR UP Major update available. https://hexo.io/
npm install --save hexo-generator-category@1.0.0 to go from 0.1.3 to 1.0.0
😕 NOTUSED? Still using hexo-generator-category?
Depcheck did not find code similar to require('hexo-generator-category') or import from 'hexo-generator-category'.
Check your code before removing as depcheck isn't able to foresee all ways dependencies can be used.
Use --skip-unused to skip this check.
To remove this package: npm uninstall --save hexo-generator-category

hexo-generator-index 😎 MAJOR UP Major update available. http://hexo.io/
npm install --save hexo-generator-index@2.0.0 to go from 0.2.1 to 2.0.0
😕 NOTUSED? Still using hexo-generator-index?
Depcheck did not find code similar to require('hexo-generator-index') or import from 'hexo-generator-index'.
Check your code before removing as depcheck isn't able to foresee all ways dependencies can be used.
Use --skip-unused to skip this check.
To remove this package: npm uninstall --save hexo-generator-index

hexo-generator-searchdb 😍 UPDATE! Your local install is out of date. https://github.com/next-theme/hexo-generator-searchdb#readme
npm install --save hexo-generator-searchdb@1.4.0 to go from 1.2.0 to 1.4.0
😕 NOTUSED? Still using hexo-generator-searchdb?
Depcheck did not find code similar to require('hexo-generator-searchdb') or import from 'hexo-generator-searchdb'.
Check your code before removing as depcheck isn't able to foresee all ways dependencies can be used.
Use --skip-unused to skip this check.
To remove this package: npm uninstall --save hexo-generator-searchdb

hexo-generator-tag 😎 MAJOR UP Major update available. http://hexo.io/
npm install --save hexo-generator-tag@1.0.0 to go from 0.2.0 to 1.0.0
😕 NOTUSED? Still using hexo-generator-tag?
Depcheck did not find code similar to require('hexo-generator-tag') or import from 'hexo-generator-tag'.
Check your code before removing as depcheck isn't able to foresee all ways dependencies can be used.
Use --skip-unused to skip this check.
To remove this package: npm uninstall --save hexo-generator-tag

hexo-pagination 😎 MAJOR UP Major update available. https://hexo.io/
npm install --save hexo-pagination@2.0.0 to go from 0.1.0 to 2.0.0
😕 NOTUSED? Still using hexo-pagination?
Depcheck did not find code similar to require('hexo-pagination') or import from 'hexo-pagination'.
Check your code before removing as depcheck isn't able to foresee all ways dependencies can be used.
Use --skip-unused to skip this check.
To remove this package: npm uninstall --save hexo-pagination

hexo-renderer-ejs 😎 MAJOR UP Major update available. https://github.com/hexojs/hexo-renderer-ejs#readme
npm install --save hexo-renderer-ejs@2.0.0 to go from 0.3.1 to 2.0.0
😕 NOTUSED? Still using hexo-renderer-ejs?
Depcheck did not find code similar to require('hexo-renderer-ejs') or import from 'hexo-renderer-ejs'.
Check your code before removing as depcheck isn't able to foresee all ways dependencies can be used.
Use --skip-unused to skip this check.
To remove this package: npm uninstall --save hexo-renderer-ejs

hexo-renderer-less 😎 MAJOR UP Major update available. https://github.com/hexojs/hexo-renderer-less#readme
npm install --save hexo-renderer-less@4.0.0 to go from 0.2.0 to 4.0.0
😕 NOTUSED? Still using hexo-renderer-less?
Depcheck did not find code similar to require('hexo-renderer-less') or import from 'hexo-renderer-less'.
Check your code before removing as depcheck isn't able to foresee all ways dependencies can be used.
Use --skip-unused to skip this check.
To remove this package: npm uninstall --save hexo-renderer-less

hexo-renderer-marked 😎 MAJOR UP Major update available. https://github.com/hexojs/hexo-renderer-marked#readme
npm install --save hexo-renderer-marked@5.0.0 to go from 0.3.2 to 5.0.0
😕 NOTUSED? Still using hexo-renderer-marked?
Depcheck did not find code similar to require('hexo-renderer-marked') or import from 'hexo-renderer-marked'.
Check your code before removing as depcheck isn't able to foresee all ways dependencies can be used.
Use --skip-unused to skip this check.
To remove this package: npm uninstall --save hexo-renderer-marked

hexo-renderer-stylus 😎 MAJOR UP Major update available. https://github.com/hexojs/hexo-renderer-stylus#readme
npm install --save hexo-renderer-stylus@2.0.1 to go from 0.3.3 to 2.0.1
😕 NOTUSED? Still using hexo-renderer-stylus?
Depcheck did not find code similar to require('hexo-renderer-stylus') or import from 'hexo-renderer-stylus'.
Check your code before removing as depcheck isn't able to foresee all ways dependencies can be used.
Use --skip-unused to skip this check.
To remove this package: npm uninstall --save hexo-renderer-stylus

hexo-server 😎 MAJOR UP Major update available. http://hexo.io/
npm install --save hexo-server@3.0.0 to go from 0.3.3 to 3.0.0
😕 NOTUSED? Still using hexo-server?
Depcheck did not find code similar to require('hexo-server') or import from 'hexo-server'.
Check your code before removing as depcheck isn't able to foresee all ways dependencies can be used.
Use --skip-unused to skip this check.
To remove this package: npm uninstall --save hexo-server

gulp 😟 MISSING! Not installed.
😟 PKG ERR! Not in the package.json. Found in: \themes\themes\next\gulpfile.coffee

jshint-stylish 😟 MISSING! Not installed.
😟 PKG ERR! Not in the package.json. Found in: \themes\themes\next\gulpfile.coffee

js-yaml 😟 PKG ERR! Not in the package.json. Found in: \themes\themes\next\gulpfile.coffee
😎 MAJOR UP Major update available. https://github.com/nodeca/js-yaml#readme
npm install --save js-yaml@4.1.0 to go from 3.12.0 to 4.1.0

hexo-util 😟 PKG ERR! Not in the package.json. Found in: \themes\themes\next\scripts\tags\exturl.js
😎 MAJOR UP Major update available. https://hexo.io/
npm install --save hexo-util@2.6.0 to go from 0.6.3 to 2.6.0

欢迎关注我的其它发布渠道