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",
相关文章
|
6月前
|
JavaScript 算法 Linux
【vue报错】error:0308010C:digital envelope routines::unsupported
【vue报错】error:0308010C:digital envelope routines::unsupported
150 3
|
3月前
Node——activeError: error:0308010C:digital envelope routines::unsupported
启动项目报错error:0308010C:digital envelope routines::unsupported,其实很简单因为node版本的原因,本地默认的版本是v20.15.0,项目是老项目默认的版本是v16.16.0;
104 2
|
3月前
|
JavaScript 前端开发
NodeJs——error:03000086:digital envelope routines::initialization error
NodeJs——error:03000086:digital envelope routines::initialization error
65 0
|
3月前
|
JavaScript 算法 数据安全/隐私保护
Vue 打包 Error: error:0308010C:digital envelope routines::unsupported
Vue 打包 Error: error:0308010C:digital envelope routines::unsupported
60 0
Error: error:0308010C:digital envelope routines::unsupported
Error: error:0308010C:digital envelope routines::unsupported
|
5月前
|
JavaScript 算法
“Error: error:0308010C:digital envelope routines::unsupported”启动vue项目遇到一个错误【已解决
“Error: error:0308010C:digital envelope routines::unsupported”启动vue项目遇到一个错误【已解决
97 1
|
5月前
|
Linux Windows
【已解决】Error: error:0308010C:digital envelope routines::unsupported
【已解决】Error: error:0308010C:digital envelope routines::unsupported
157 0
|
6月前
|
JavaScript 安全 网络安全
Node: opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error‘ ]异常处理
Node: opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error‘ ]异常处理
2842 0
|
6月前
|
人工智能 JavaScript 算法
Vue 报错 error:0308010C:digital envelope routines::unsupported
Vue 报错 error:0308010C:digital envelope routines::unsupported
|
6月前
|
JavaScript 算法 Windows
95% emitting CompressionPlugin ERROR Error: error:0308010C:digital envelope routines::unsupported
95% emitting CompressionPlugin ERROR Error: error:0308010C:digital envelope routines::unsupported
860 0