开发vue的项目中,node为v18.17.0。运行项目时报错:

opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'

原因是:大于v17+ 版本出现的问题

解决办法: 

在scripts中加入

export NODE_OPTIONS=--openssl-legacy-provider

如下 

"scripts": {

"serve": "export NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",

"build": "export NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build",

"lint": "export NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service lint"

},
GitHub 加速计划 / ope / openssl
25.13 K
9.99 K
下载
传输层安全性/安全套接层及其加密库
最近提交(Master分支:1 个月前 )
fd39d1c8 Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/25095) 3 个月前
ae87c488 Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/25095) 3 个月前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐