gpt4 book ai didi

node.js - 如何修复 vue 中的 'ERR_OSSL_EVP_UNSUPPORTED' 错误?

转载 作者:行者123 更新时间:2023-12-05 03:28:23 26 4
gpt4 key购买 nike

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

Node.js v17.4.0

当执行npm run service时,会出现这个错误。目前node是v16.14.0版本,由于node v17经常出现这些错误,所以不断重装还是重复同样的错误。

"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"
},

如果使用上面的代码,是可以执行的,但是用docker构建镜像的时候又出现了问题。有解决办法吗?

最佳答案

在你的 package.json 中添加如下内容,省略导出,它对我有用

 "scripts": {
"serve": "NODE_OPTIONS=--openssl-legacy-provider vue-cli-service serve",
},

关于node.js - 如何修复 vue 中的 'ERR_OSSL_EVP_UNSUPPORTED' 错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71273466/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com