当前位置: 首页 > article >正文

Error: error:0308010C:digital envelope routines::unsupported

Error: error:0308010C:digital envelope routines::unsupported

问题描述:

使用 npm run dev 或者 yarn run dev 时
报错:Error: error:0308010C:digital envelope routines::unsupported

PS D:\Project\dlspeed_all\GS-IMS\ruoyi-ui> npm run dev

> ruoyi-vue-plus@4.7.0 dev
> vue-cli-service serve   

 INFO  Starting development server...
10% building 2/4 modules 2 active D:\Project\dlspeed_all\GS-IMS\ruoyi-ui\node_modules\webpack\hot\dev-server.jsError: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:69:19)
    at Object.createHash (node:crypto:133:10)
    at module.exports (D:\Project\dlspeed_all\GS-IMS\ruoyi-ui\node_modules\webpack\lib\util\createHash.js:135:53)
    at NormalModule._initBuildHash (D:\Project\dlspeed_all\GS-IMS\ruoyi-ui\node_modules\webpack\lib\NormalModule.js:417:16)
    at handleParseError (D:\Project\dlspeed_all\GS-IMS\ruoyi-ui\node_modules\webpack\lib\NormalModule.js:471:10)
    at D:\Project\dlspeed_all\GS-IMS\ruoyi-ui\node_modules\webpack\lib\NormalModule.js:503:5
    at D:\Project\dlspeed_all\GS-IMS\ruoyi-ui\node_modules\webpack\lib\NormalModule.js:358:12
    at D:\Project\dlspeed_all\GS-IMS\ruoyi-ui\node_modules\loader-runner\lib\LoaderRunner.js:373:3
    at iterateNormalLoaders (D:\Project\dlspeed_all\GS-IMS\ruoyi-ui\node_modules\loader-runner\lib\LoaderRunner.js:214:10)
    at iterateNormalLoaders (D:\Project\dlspeed_all\GS-IMS\ruoyi-ui\node_modules\loader-runner\lib\LoaderRunner.js:221:10)
    at D:\Project\dlspeed_all\GS-IMS\ruoyi-ui\node_modules\loader-runner\lib\LoaderRunner.js:236:3
    at runSyncOrAsync (D:\Project\dlspeed_all\GS-IMS\ruoyi-ui\node_modules\loader-runner\lib\LoaderRunner.js:130:11)
    at iterateNormalLoaders (D:\Project\dlspeed_all\GS-IMS\ruoyi-ui\node_modules\loader-runner\lib\LoaderRunner.js:232:2)
    at Array.<anonymous> (D:\Project\dlspeed_all\GS-IMS\ruoyi-ui\node_modules\loader-runner\lib\LoaderRunner.js:205:4)
    at Storage.finished (D:\Project\dlspeed_all\GS-IMS\ruoyi-ui\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:55:16)
    at D:\Project\dlspeed_all\GS-IMS\ruoyi-ui\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:91:9
10% building 2/5 modules 3 active ...loader\lib\index.js!D:\Project\dlspeed_all\GS-IMS\ruoyi-ui\node_modules\eslint-loader\index.js??ref--13-0!D:\Project\dlspeed_all\GS-IMS\ruoyi-ui\src\main.js n
ode:internal/crypto/hash:69
  this[kHandle] = new _Hash(algorithm, xofLen);
                  ^

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

报错原因:

因为 node.js V17版本 中最近发布的 OpenSSL3.0, 而 OpenSSL3.0 对允许算法和密钥大小增加了严格的限制

解决方案:

修改 package.json 文件
在相关构建命令之前加入 set NODE_OPTIONS=--openssl-legacy-provider
“scripts”: {
“dev”: “set NODE_OPTIONS=–openssl-legacy-provider & node build/dev-server.js”,
“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”
},
例:如果你使用的命令是 npm run dev,那么就在 scripts 命令下的 dev 命令前面加
如果是 Linux 或者 WSL 环境,请加入 export NODE_OPTIONS=--openssl-legacy-provider


http://www.kler.cn/a/108753.html

相关文章:

  • 【Linux】进程池实现指南:掌控并发编程的核心
  • 数学建模模型算法-Python实现
  • 网络安全-Linux基础(bash脚本)
  • 【循环神经网络】
  • 如何在 Ubuntu 16.04 上设置 NFS 挂载
  • SSE (Server-Sent Events) 服务器实时推送详解
  • YOLOv7-QAT量化部署
  • 软考系统架构师知识点集锦二:软件工程
  • 51单片机实验:数码管动态显示00-99
  • Vert.x学习笔记-异步编程和响应式系统
  • 云安全-云原生技术架构(Docker逃逸技术-特权与危险挂载)
  • 外部中断0边沿触发
  • Docker中Failed to initialize NVML: Unknown Error
  • 3DMAX快速瓦片屋顶铺设插件使用方法详解
  • JavaScript进阶知识汇总~
  • Linux--进程替换
  • C++中的成员变量内存布局
  • MinIO安装
  • Ubuntu ARMv8编译Qt源码以及QtCreator
  • NEFU数字图像处理(三)图像分割
  • 安全狗安装
  • Angular-05:管道
  • ip地址默认子网掩码怎么算
  • 案例分析大汇总
  • IT行业就业热点与发展方向
  • 获取客户端请求IP及IP所属城市