首页 > 其他分享 >解决Error: error:0308010C:digital envelope routines::unsupported的四种解决方案

解决Error: error:0308010C:digital envelope routines::unsupported的四种解决方案

时间:2024-03-12 14:57:33浏览次数:29  
标签:node 0308010C cobase routines modules roof js digital webclient

问题描述: 前端项目自定义webpack自动构建项目,启动时报错:Error: error:0308010C:digital envelope routines::unsupported

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

报错详细信息:

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:71:19)
    at Object.createHash (node:crypto:133:10)
    at filename (E:\roof\cobase_webclient\node_modules\babel-loader\lib\fs-cache.js:76:21)
    at E:\roof\cobase_webclient\node_modules\babel-loader\lib\fs-cache.js:107:37
    at E:\roof\cobase_webclient\node_modules\mkdirp\index.js:51:26
    at FSReqCallback.oncomplete (node:fs:209:5) {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v18.16.1
HappyThread[0]: unable to send to worker! Error: write EPIPE
    at target._send (node:internal/child_process:865:20)
    at target.send (node:internal/child_process:738:19)
    at processSend (E:\roof\cobase_webclient\node_modules\happypack\lib\processSend.js:8:15)
    at deliver (E:\roof\cobase_webclient\node_modules\happypack\lib\BufferedFd.js:26:3)
    at E:\roof\cobase_webclient\node_modules\happypack\lib\BufferedFd.js:33:9
    at process.processTicksAndRejections (node:internal/process/task_queues:77:11) {
  errno: -4047,
  code: 'EPIPE',
  syscall: 'write'
}
HappyThread[0]: unable to send to worker! Error: write EPIPE
    at target._send (node:internal/child_process:865:20)
    at target.send (node:internal/child_process:738:19)
    at processSend (E:\roof\cobase_webclient\node_modules\happypack\lib\processSend.js:8:15)
    at deliver (E:\roof\cobase_webclient\node_modules\happypack\lib\BufferedFd.js:26:3)
    at E:\roof\cobase_webclient\node_modules\happypack\lib\BufferedFd.js:33:9
    at process.processTicksAndRejections (node:internal/process/task_queues:77:11) {
  errno: -4047,
  code: 'EPIPE',
  syscall: 'write'
}
node: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 filename (E:\roof\cobase_webclient\node_modules\babel-loader\lib\fs-cache.js:76:21)
    at E:\roof\cobase_webclient\node_modules\babel-loader\lib\fs-cache.js:107:37
    at E:\roof\cobase_webclient\node_modules\mkdirp\index.js:51:26
    at FSReqCallback.oncomplete (node:fs:209:5) {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v18.16.1
node: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 filename (E:\roof\cobase_webclient\node_modules\babel-loader\lib\fs-cache.js:76:21)
    at E:\roof\cobase_webclient\node_modules\babel-loader\lib\fs-cache.js:107:37
    at E:\roof\cobase_webclient\node_modules\mkdirp\index.js:51:26
    at FSReqCallback.oncomplete (node:fs:209:5) {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v18.16.1
node: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 filename (E:\roof\cobase_webclient\node_modules\babel-loader\lib\fs-cache.js:76:21)
    at E:\roof\cobase_webclient\node_modules\babel-loader\lib\fs-cache.js:107:37
    at E:\roof\cobase_webclient\node_modules\mkdirp\index.js:51:26
    at FSReqCallback.oncomplete (node:fs:209:5) {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v18.16.1
node: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 filename (E:\roof\cobase_webclient\node_modules\babel-loader\lib\fs-cache.js:76:21)
    at E:\roof\cobase_webclient\node_modules\babel-loader\lib\fs-cache.js:107:37
    at E:\roof\cobase_webclient\node_modules\mkdirp\index.js:51:26
    at FSReqCallback.oncomplete (node:fs:209:5) {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v18.16.1
node: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 filename (E:\roof\cobase_webclient\node_modules\babel-loader\lib\fs-cache.js:76:21)
    at E:\roof\cobase_webclient\node_modules\babel-loader\lib\fs-cache.js:107:37
    at E:\roof\cobase_webclient\node_modules\mkdirp\index.js:51:26
    at FSReqCallback.oncomplete (node:fs:209:5) {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v18.16.1
node: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 filename (E:\roof\cobase_webclient\node_modules\babel-loader\lib\fs-cache.js:76:21)
    at E:\roof\cobase_webclient\node_modules\babel-loader\lib\fs-cache.js:107:37
    at E:\roof\cobase_webclient\node_modules\mkdirp\index.js:51:26
    at FSReqCallback.oncomplete (node:fs:209:5) {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v18.16.1
node: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 filename (E:\roof\cobase_webclient\node_modules\babel-loader\lib\fs-cache.js:76:21)
    at E:\roof\cobase_webclient\node_modules\babel-loader\lib\fs-cache.js:107:37
    at E:\roof\cobase_webclient\node_modules\mkdirp\index.js:51:26
    at FSReqCallback.oncomplete (node:fs:209:5) {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v18.16.1
node: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 filename (E:\roof\cobase_webclient\node_modules\babel-loader\lib\fs-cache.js:76:21)
    at E:\roof\cobase_webclient\node_modules\babel-loader\lib\fs-cache.js:107:37
    at E:\roof\cobase_webclient\node_modules\mkdirp\index.js:51:26
    at FSReqCallback.oncomplete (node:fs:209:5) {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v18.16.1
node: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 filename (E:\roof\cobase_webclient\node_modules\babel-loader\lib\fs-cache.js:76:21)
    at E:\roof\cobase_webclient\node_modules\babel-loader\lib\fs-cache.js:107:37
    at E:\roof\cobase_webclient\node_modules\mkdirp\index.js:51:26
    at FSReqCallback.oncomplete (node:fs:209:5) {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v18.16.1
node: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 filename (E:\roof\cobase_webclient\node_modules\babel-loader\lib\fs-cache.js:76:21)
    at E:\roof\cobase_webclient\node_modules\babel-loader\lib\fs-cache.js:107:37
    at E:\roof\cobase_webclient\node_modules\mkdirp\index.js:51:26
    at FSReqCallback.oncomplete (node:fs:209:5) {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v18.16.1
node: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 filename (E:\roof\cobase_webclient\node_modules\babel-loader\lib\fs-cache.js:76:21)
    at E:\roof\cobase_webclient\node_modules\babel-loader\lib\fs-cache.js:107:37
    at E:\roof\cobase_webclient\node_modules\mkdirp\index.js:51:26
    at FSReqCallback.oncomplete (node:fs:209:5) {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v18.16.1
node: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 filename (E:\roof\cobase_webclient\node_modules\babel-loader\lib\fs-cache.js:76:21)
    at E:\roof\cobase_webclient\node_modules\babel-loader\lib\fs-cache.js:107:37
    at E:\roof\cobase_webclient\node_modules\mkdirp\index.js:51:26
    at FSReqCallback.oncomplete (node:fs:209:5) {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v18.16.1
node: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 filename (E:\roof\cobase_webclient\node_modules\babel-loader\lib\fs-cache.js:76:21)
    at E:\roof\cobase_webclient\node_modules\babel-loader\lib\fs-cache.js:107:37
    at E:\roof\cobase_webclient\node_modules\mkdirp\index.js:51:26
    at FSReqCallback.oncomplete (node:fs:209:5) {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v18.16.1
node: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 filename (E:\roof\cobase_webclient\node_modules\babel-loader\lib\fs-cache.js:76:21)
    at E:\roof\cobase_webclient\node_modules\babel-loader\lib\fs-cache.js:107:37
    at E:\roof\cobase_webclient\node_modules\mkdirp\index.js:51:26
    at FSReqCallback.oncomplete (node:fs:209:5) {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v18.16.1

 

解决方案:
方案1:打开IDEA 终端,直接输入

Linux & Mac OS:

export NODE_OPTIONS=--openssl-legacy-provider
Windows:

set NODE_OPTIONS=--openssl-legacy-provider
方案2:打开IDEA 终端,直接输入(问题解决)
$env:NODE_OPTIONS="--openssl-legacy-provider"

方案3:卸载当前版本,安装合适的版本(node.js)

方案4:

解决方式(仅限 windows):

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

添加前:

 

"scripts": {
    "server": "webpack-dev-server --env.server --env.develop --inline --max-old-space-size=3000",  
.
.
}

 


添加后:

 

"scripts": {
    "server": "SET NODE_OPTIONS=--openssl-legacy-provider && webpack-dev-server --env.server --env.develop --inline --max-old-space-size=3000",  
.
.
}

 

标签:node,0308010C,cobase,routines,modules,roof,js,digital,webclient
From: https://www.cnblogs.com/litterjoan/p/18068303

相关文章

  • Netlify、Vercel 和 Digital Ocean代码托管平台介绍
    Netlify、Vercel和DigitalOcean都是用于部署Web应用程序的平台,它们各有特点和适用场景:Netlify:Netlify是一个现代化的静态站点部署平台,它提供了简单易用的界面和强大的功能,特别适合部署静态网站、单页面应用和Jamstack应用。Netlify提供了自动构建、部署、CDN加速......
  • vue报错: error:0308010C:digital envelope routines::unsupported
    问题解决参考:https://blog.csdn.net/m0_65933139/article/details/130690790问题描述:报错:Error:error:0308010C:digitalenveloperoutines::unsupported报错原因:因为node.jsV17版本中最近发布的OpenSSL3.0,而OpenSSL3.0对允许算法和密钥大小增加了严格的......
  • {fastcluster}:快速分层聚类程序(Fast Hierarchical Clustering Routines)
    1.函数代码该R包中最主要的函数是 hclust ,代码如下:>fastcluster::hclustfunction(d,method="complete",members=NULL){if(method=="ward"){message("The\"ward\"methodhasbeenrenamedto\"ward.D\&quo......
  • golang 死锁 all goroutines are asleep - deadlock!
    channel死锁packagemainimport"fmt"funcmain(){ch:=make(chanstring)fori:=0;i<10;i++{s:=<-chfmt.Println(s)}gofunc(chchanstring){fori:=0;i<10;i++{......
  • Error: error:0308010C:digital envelope routines::unsupported
    概述使用若依框架,启动UI执行命令npmrundev时报错误:Error:error:0308010C:digitalenveloperoutines::unsupportedINFOStartingdevelopmentserver...95%emittingCompressionPluginERRORError:error:0308010C:digitalenveloperoutines::unsupportedError:er......
  • CodeForces 1928F Digital Patterns
    洛谷传送门CF传送门为什么我场上被卡常了。转化题意,将\(a,b\)差分,答案为在\(a,b\)选出相同长度的不含\(0\)的子段方案数。设\(a\)选出长度为\(i\)的不含\(0\)的子段方案数为\(x_i\),\(b\)选出长度为\(i\)的不含\(0\)的子段方案数为\(y_i\)。答案为\(\su......
  • Educational Codeforces Round 135 (Rated for Div. 2)C. Digital Logarithm(思维)
    目录题目链接题意题解代码题目链接C.DigitalLogarithm题意给两个长度位\(n\)的数组\(a\)、\(b\),一个操作\(f\)定义操作\(f\)为,\(a[i]=f(a[i])=a[i]\)的位数求最少多少次操作可以使\(a、b\)两个数组变得完全相同题解性质:对于任何数,经过两次操作我们一定可以让其变为\(......
  • [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......