首页 > 其他分享 >Error: error:0308010C:digital envelope routines::unsupported

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

时间:2024-02-14 11:23:01浏览次数:35  
标签:node 0308010C vue cli -- routines envelope js build

概述

使用若依框架,启动UI执行命令npm run dev时报错误:Error: error:0308010C:digital envelope routines::unsupported

 INFO  Starting development server...
95% emitting CompressionPlugin ERROR  Error: error:0308010C:digital envelope routines::unsupported
Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:71:19)
    at Object.createHash (node:crypto:133:10)
    at D:\Project\RuoYi\ruoyi-ui\node_modules\compression-webpack-plugin\dist\index.js:243:42
    at CompressionPlugin.compress (D:\Project\RuoYi\ruoyi-ui\node_modules\compression-webpack-plugin\dist\index.js:284:9)
    at D:\Project\RuoYi\ruoyi-ui\node_modules\compression-webpack-plugin\dist\index.js:305:12
    at _next1 (eval at create (D:\Project\RuoYi\ruoyi-ui\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:14:17)
    at eval (eval at create (D:\Project\RuoYi\ruoyi-ui\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:33:1)
    at D:\Project\RuoYi\ruoyi-ui\node_modules\copy-webpack-plugin\dist\index.js:91:9

分析

因为 nodeJs V17 版本发布了 OpenSSL3.0 对算法和秘钥大小增加了更为严格的限制,nodeJs v17 之前版本没影响,但 V17 和之后版本会出现这个错误。 我的node版本是v18.12.0

解决方案

解决方式(仅限 windows):

在项目中 package.json 的 scripts 中新增 SET NODE_OPTIONS=--openssl-legacy-provider

添加前:

  "scripts": {
    "dev": "vue-cli-service serve",
    "build:prod": "vue-cli-service build",
    "build:stage": "vue-cli-service build --mode staging",
    "preview": "node build/index.js --preview",
    "lint": "eslint --ext .js,.vue src"
  },

  

添加后:

 "scripts": {
	"dev": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",
	"build:prod": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build",
    "build:stage": "vue-cli-service build --mode staging",
    "preview": "node build/index.js --preview",
    "lint": "eslint --ext .js,.vue src"
  },

  

运行成功

标签:node,0308010C,vue,cli,--,routines,envelope,js,build
From: https://www.cnblogs.com/smallstone/p/18015091

相关文章

  • [Go] Go routines with WaitGroup and async call
    So,let'ssaywehaveafunctiontofetchcryptocurrenciesprice:packagemainimport( "fmt" "sync" "project/api")funcmain(){gogetCurrencyData("BTC")gogetCurrencyData("BCH")......
  • [ Go] GoRoutines and Channels
    AgoroutineistheGowayofsuingthreads,weopenagoroutinejustbyinvokinganyfunctionwithagoprefix.gofunctionCall()Goroutinescancommunicatethroughchannels,anspecialtypeofvariable,achannelcontainsavalueofanykind,aroutinec......
  • NodeJs——error:03000086:digital envelope routines::initialization error
    前言vue2前端项目在服务器上打包报错,发现是高版本的node使用的是OpenSSL3.0,导致的不兼容,所以先临时抛出下环境变量,继续使用老板本的OpenSSL的实现;步骤解决方法exportNODE_OPTIONS=--openssl-legacy-provider具体报错信息root@iZuf6f5trc95ufa25hqb6eZ:/www/wwwroot/ad-cl......
  • Error: error:0308010C:digital envelope routines::unsupported 【问题解决】【转载
    原文链接:  https://www.cnblogs.com/jaxu/p/17171211.html今天早上打开电脑,更新了日常工作的github仓库,然后就是习惯性地执行了"npminstall",发现报了下面这个错误:Error:error:0308010C:digitalenveloperoutines::unsupported顺便看了一下错误堆栈,发现是一个Node......
  • 记Redux下载后,运行examples/todos时,报错Error: error:0308010C:digital envelope rout
    1、Redux下载下载地址gitclonehttps://github.com/reactjs/redux.git进入examples/todos,下载依赖:npminstall2、问题复现及解决执行命令npmrunstart此时终端报错:Error:error:0308010C:digitalenveloperoutines::unsupported解决方法:打开package.json,修改......
  • 快速解决Error: error:0308010C:digital envelope routines::unsupported的三种解决方
    问题描述:    报错:Error:error:0308010C:digitalenveloperoutines::unsupported报错原因:     因为node.jsV17版本中最近发布的OpenSSL3.0,而OpenSSL3.0对允许算法和密钥大小增加了严格的限制报错详细信息:解决方案: 方案1:打开IDEA终端,直接输入Linux&......
  • error:0308010C:digital envelope routines::unsupported
    执行:npmrunserve 出现:error:0308010C:digitalenveloperoutines::unsupported原因:npm版本升级解决:package.json增加配置"scripts":{"serve":"setNODE_OPTIONS=--openssl-legacy-provider&&vue-cli-serviceserve","b......
  • error:0308010C:digital envelope routines::unsupported问题解决
    问题描述:报错:Error:error:0308010C:digitalenveloperoutines::unsupported报错原因:因为node.jsV17版本中最近发布的OpenSSL3.0,而OpenSSL3.0对允许算法和密钥大小增加了严格的限制报错详细信息:解决方案:方案1:打开IDEA终端,直接输入Linux&MacOS:exportNODE_OPTI......
  • vue前端项目启动报错:error:0308010C:digital envelope routines::unsupported
    问题描述使用 npmrundev 或者 yarnrundev 时报错:error:0308010C:digitalenveloperoutines::unsupported解决方案修改package.json,在相关构建命令之前加入setNODE_OPTIONS=--openssl-legacy-provider"scripts":{"dev":"setNODE_OPTIONS=--openssl-legacy-provide......
  • 若依vue启动报Error: error:0308010C:digital envelope routines::unsupported
    解决:若依vue启动报Error:error:0308010C:digitalenveloperoutines::unsupported1.描述:问题产生原因是因为node.jsV17版本中最近发布的OpenSSL3.0,而OpenSSL3.0对允许算法和密钥大小增加了严格的限制,可能会对生态系统造成一些影响.解决方法:有很多种,我把适合我的写在第一......