如何解决vue-admin-better数字信封例程提示不受支持的问题

Admin 2023-04-07 群英技术资讯 926 次浏览

这篇文章我们来了解“如何解决vue-admin-better数字信封例程提示不受支持的问题”的内容,小编通过实际的案例向大家展示了操作过程,简单易懂,有需要的朋友可以参考了解看看,那么接下来就跟随小编的思路来往下学习吧,希望对大家学习或工作能有帮助。


 

这两天准备在github上找一个vue3的后台框架学习一下,后来找到一个vue-admin-better这个VUE3开发后台框架,感觉不错,准备安装了跑起来看一看效果

就运行

npm run serve

结果就报一堆错误

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:71:19)
    at Object.createHash (node:crypto:133:10)
    at module.exports (D:\home\project\demo\vue-admin-better\node_modules\webpack\lib\util\createHash.js:135:53)
    at NormalModule._initBuildHash (D:\home\project\demo\vue-admin-better\node_modules\webpack\lib\NormalModule.js:417:16)
    at handleParseError (D:\home\project\demo\vue-admin-better\node_modules\webpack\lib\NormalModule.js:471:10)
    at D:\home\project\demo\vue-admin-better\node_modules\webpack\lib\NormalModule.js:503:5
    at D:\home\project\demo\vue-admin-better\node_modules\webpack\lib\NormalModule.js:358:12
    at D:\home\project\demo\vue-admin-better\node_modules\loader-runner\lib\LoaderRunner.js:373:3
    at iterateNormalLoaders (D:\home\project\demo\vue-admin-better\node_modules\loader-runner\lib\LoaderRunner.js:214:10)
    at iterateNormalLoaders (D:\home\project\demo\vue-admin-better\node_modules\loader-runner\lib\LoaderRunner.js:221:10)
    at D:\home\project\demo\vue-admin-better\node_modules\loader-runner\lib\LoaderRunner.js:236:3
    at runSyncOrAsync (D:\home\project\demo\vue-admin-better\node_modules\loader-runner\lib\LoaderRunner.js:130:11)
    at iterateNormalLoaders (D:\home\project\demo\vue-admin-better\node_modules\loader-runner\lib\LoaderRunner.js:232:2)
    at Array.<anonymous> (D:\home\project\demo\vue-admin-better\node_modules\loader-runner\lib\LoaderRunner.js:205:4)
    at Storage.finished (D:\home\project\demo\vue-admin-better\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:55:16)
    at D:\home\project\demo\vue-admin-better\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:91:9
10% building 2/5 modules 3 active ...dmin-better\node_modules\eslint-loader\index.js??ref--14-0!D:\home\project\demo\vue-admin-better\src\main.jsnode:internal/crypto/hash:71
  this[kHandle] = new _Hash(algorithm, xofLen);
                  ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:71:19)
    at Object.createHash (node:crypto:133:10)
    at module.exports (D:\home\project\demo\vue-admin-better\node_modules\webpack\lib\util\createHash.js:135:53)
    at NormalModule._initBuildHash (D:\home\project\demo\vue-admin-better\node_modules\webpack\lib\NormalModule.js:417:16)
    at handleParseError (D:\home\project\demo\vue-admin-better\node_modules\webpack\lib\NormalModule.js:471:10)
    at D:\home\project\demo\vue-admin-better\node_modules\webpack\lib\NormalModule.js:503:5
    at D:\home\project\demo\vue-admin-better\node_modules\webpack\lib\NormalModule.js:358:12
    at D:\home\project\demo\vue-admin-better\node_modules\loader-runner\lib\LoaderRunner.js:373:3
    at iterateNormalLoaders (D:\home\project\demo\vue-admin-better\node_modules\loader-runner\lib\LoaderRunner.js:214:10)
    at Array.<anonymous> (D:\home\project\demo\vue-admin-better\node_modules\loader-runner\lib\LoaderRunner.js:205:4)
    at Storage.finished (D:\home\project\demo\vue-admin-better\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:55:16)
    at D:\home\project\demo\vue-admin-better\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:91:9
    at D:\home\project\demo\vue-admin-better\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'
}

Baidu 了一下发现是 Node JS 17 的 BUG,相关 ISSUE 也给出了解决办法,就是修改package.json,在相关构建命令之前加入set NODE_OPTIONS=–openssl-legacy-provider

"scripts": {
    "serve": "set NODE_OPTIONS=--openssl-legacy-provider & vue-cli-service serve",
    "build": "set NODE_OPTIONS=--openssl-legacy-provider & vue-cli-service build",
    "build:report": "set NODE_OPTIONS=--openssl-legacy-provider & vue-cli-service build --report",

如果是 Linux 或者 WSL 环境,请加入

export NODE_OPTIONS=--openssl-legacy-provider

如果是windows ,我的电脑上右键–>属性—>高级系统设置

保存后windows需要重启一下电脑

然后就可以运行npm打包命令不会报错了


到此,关于“如何解决vue-admin-better数字信封例程提示不受支持的问题”的学习就结束了,希望能够解决大家的疑惑,另外大家动手实践也很重要,对大家加深理解和学习很有帮助。如果想要学习更多的相关知识,欢迎关注群英网络,小编每天都会给大家分享实用的文章!

群英智防CDN,智能加速解决方案

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:mmqy2019@163.com进行举报,并提供相关证据,查实之后,将立刻删除涉嫌侵权内容。

猜你喜欢

成为群英会员,开启智能安全云计算之旅

立即注册
专业资深工程师驻守
7X24小时快速响应
一站式无忧技术支持
免费备案服务
免费拨打  400-678-4567
免费拨打  400-678-4567 免费拨打 400-678-4567 或 0668-2555555
在线客服
微信公众号
返回顶部
返回顶部 返回顶部
在线客服
在线客服