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

简介: # 报错(node:16863) [DEP_WEBPACK_CONFIGURATION_OPTIMIZATION_NO_EMIT_ON_ERRORS] DeprecationWarning: optimization.noEmitOnErrors is deprecated in favor of optimization.emitOnErrors(Use `node --trace-deprecation ...` to show where the warning was created)(node:16863) [DEP_WEBPACK_COMPILATION_OPTIMIZE_C

报错

(node:16863) [DEP_WEBPACK_CONFIGURATION_OPTIMIZATION_NO_EMIT_ON_ERRORS] DeprecationWarning: optimization.noEmitOnErrors is deprecated in favor of optimization.emitOnErrors
(Use node --trace-deprecation ... to show where the warning was created)
(node:16863) [DEP_WEBPACK_COMPILATION_OPTIMIZE_CHUNK_ASSETS] DeprecationWarning: optimizeChunkAssets is deprecated (use Compilation.hooks.processAssets instead and use one of Compilation.PROCESS_ASSETSSTAGE* as stage option)
(node:16863) [DEP_WEBPACK_COMPILATION_NORMAL_MODULE_LOADER_HOOK] DeprecationWarning: Compilation.hooks.normalModuleLoader was moved to NormalModule.getCompilationHooks(compilation).loader
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)

问题原因

出现这个错误是因为 node.js V17版本中最近发布的OpenSSL3.0, 而OpenSSL3.0对允许算法和密钥大小增加了严格的限制,可能会对生态系统造成一些影响.

解决方式

运行指令前设置环境变量

export NODE_OPTIONS=--openssl-legacy-provider

或者修改下脚本

  "scripts": {
    "analyze": "cross-env ANALYZE=1 umi build",
    "build": "export NODE_OPTIONS=--openssl-legacy-provider &&  umi build",
    "deploy": "npm run build && npm run gh-pages",
    "dev": "export NODE_OPTIONS=--openssl-legacy-provider &&  npm run start:dev",
相关文章
|
17天前
|
JavaScript 算法 Linux
【vue报错】error:0308010C:digital envelope routines::unsupported
【vue报错】error:0308010C:digital envelope routines::unsupported
39 3
|
7月前
QSoundEffect(qaudio): Error decoding source
QSoundEffect(qaudio): Error decoding source
140 0
|
12天前
|
算法 JavaScript
解决Error: error:0308010C:digital envelope routines::unsupported最快速方案
解决Error: error:0308010C:digital envelope routines::unsupported最快速方案
17 0
|
3天前
|
人工智能 JavaScript 算法
Vue 报错 error:0308010C:digital envelope routines::unsupported
Vue 报错 error:0308010C:digital envelope routines::unsupported
|
4月前
|
JavaScript 安全 网络安全
Node: opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error‘ ]异常处理
Node: opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error‘ ]异常处理
478 0
|
2月前
nodejs17/18版本报错:digital envelope routines::unsupported
nodejs17/18版本报错:digital envelope routines::unsupported
45 0
|
4月前
activeError: error:0308010C:digital envelope routines::unsupported
activeError: error:0308010C:digital envelope routines::unsupported
27 0
|
5月前
ERROR: Encountered errors while bringing up the project.
ERROR: Encountered errors while bringing up the project.
|
6月前
|
JavaScript 数据安全/隐私保护 内存技术
Vue 报错error:0308010C:digital envelope routines::unsupported
Vue 报错error:0308010C:digital envelope routines::unsupported
|
资源调度 JavaScript
The futex facility returned an unexpected error code
The futex facility returned an unexpected error code
601 0