VuePress错误信息
# 引言
鉴于使用VuePress
仅仅是为了好写博客的文章,所以实际过程中遇到的问题直接进行记录,用于下次直接修复。
# error:0308010C:digital envelope routines::unsupported
this[kHandle] = new _Hash(algorithm, xofLen);
^
Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:67:19)
at Object.createHash (node:crypto:130:10)
at module.exports (/vuepress-theme-vdoing/node_modules/webpack/lib/util/createHash.js:135:53)
at NormalModule._initBuildHash (/vuepress-theme-vdoing/node_modules/webpack/lib/NormalModule.js:417:16)
at handleParseError (/vuepress-theme-vdoing/node_modules/webpack/lib/NormalModule.js:471:10)
at /vuepress-theme-vdoing/node_modules/webpack/lib/NormalModule.js:503:5
at /vuepress-theme-vdoing/node_modules/webpack/lib/NormalModule.js:358:12
at /vuepress-theme-vdoing/node_modules/loader-runner/lib/LoaderRunner.js:373:3
at iterateNormalLoaders (/vuepress-theme-vdoing/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
at Array.<anonymous> (/vuepress-theme-vdoing/node_modules/loader-runner/lib/LoaderRunner.js:205:4)
at Storage.finished (/vuepress-theme-vdoing/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:55:16)
at /vuepress-theme-vdoing/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:91:9
at /vuepress-theme-vdoing/node_modules/graceful-fs/graceful-fs.js:123:16
at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3) {
opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
library: 'digital envelope routines',
reason: 'unsupported',
code: 'ERR_OSSL_EVP_UNSUPPORTED'
}
Node.js v17.3.0
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
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# 解决方案
可以通过设置环境变量来解决这个问题
# Windows
set NODE_OPTIONS=--openssl-legacy-provider
# Linux
export NODE_OPTIONS=--openssl-legacy-provider
1
2
3
4
5
2
3
4
5
# Github
图床推荐
本解决方案以我博客 (opens new window)的图床为例,项目地址:xingcxb/blog_img: 博客图片 (opens new window),在blog1
分支下
# jsdelivr
不推荐
https://cdn.jsdelivr.net/gh/xingcxb/blog_img@blog1/blog/basic/reading.png
# 基础部分 https://cdn.jsdelivr.net/gh
# GitHub用户名 xingcxb
# 项目名 blog_img
# 分支 @blog1
# 其他的就是具体的路径了
1
2
3
4
5
6
7
2
3
4
5
6
7
# staticaly
荐
https://cdn.staticaly.com/gh/xingcxb/blog_img@blog1/blog/basic/reading.png
# 基础部分 https://cdn.staticaly.com/gh
# GitHub用户名 xingcxb
# 项目名 blog_img
# 分支 @blog1
# 其他的就是具体的路径了
1
2
3
4
5
6
7
2
3
4
5
6
7
# githack
未测试
# CloudFlare
未测试
# yarn dev
无法加载文件C:\Program Files\nodejs\yarn.ps1
,因为在此系统上禁止运行脚本
# 解决方案
- 以管理员身份运行终端
- 在窗口上执行
set-ExecutionPolicy RemoteSigned
- 查看执行策略:
get-ExecutionPolicy
,如果显示的为RemoteSigned
即为处理成功
更新时间: 2023/2/26 14:13:38