116 字
1 分钟
Err Ossl Evp Unsupported
一个比较老的Vue项目,在启动时候,报错:
opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ], library: 'digital envelope routines', reason: 'unsupported', code: 'ERR_OSSL_EVP_UNSUPPORTED'问题原因是nodejs升级到17后,openssl3.0 对允许算法密钥大小增加了严格的限制,临时的解决办法是配置node_options.
# Windows 环境
$env:NODE_OPTIONS="--openssl-legacy-provider"#orset NODE_OPTIONS=--openssl-legacy-provider
# Linux or Macexport NODE_OPTIONS=--openssl-legacy-provider上述的方法是一次性的,也可以在package.json中对script进行修改,如
..."serve" : "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve"... Err Ossl Evp Unsupported
https://blog.cuixu.cn/posts/node/err-ossl-evp-unsupported/