Vue报错ERR_OSSL_EVP_UNSUPPORTED解决方法
现象
在Vue项目中,启动时报错ERR_OSSL_EVP_UNSUPPORTED。
具体报错内容:
at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3) {
opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error' ],
library: ‘digital envelope routines',
reason: ‘unsupported',
code: ‘ERR_OSSL_EVP_UNSUPPORTED'
}
报错原因
由于node.js版本过高导致和以前的openssl版本不兼容。
解决方法
提供了两种解决方法,二选一。
1.设置环境变量
windows平台:使用命令行输入如下命令:
set NODE_OPTIONS="--openssl-legacy-provider"
linux平台:使用命令行输入如下命令:
export NODE_OPTIONs=--openssl-legacy-provider
2.修改Vue配置文件
在Vue的配置文件package.json中,在script中的serve和build命令中添加set NODE_OPTIONS=--openssl-legacy-provider语句:
"scripts": {
"serve": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",
"build": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build",
"lint": "vue-cli-service lint"
},到此这篇关于Vue报错ERR_OSSL_EVP_UNSUPPORTED解决方法的文章就介绍到这了,更多相关Vue ERR_OSSL_EVP_UNSUPPORTED内容请搜索脚本之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持脚本之家!
- Vue项目报错:Uncaught SyntaxError: Unexpected token <
- 解决vue net :ERR_CONNECTION_REFUSED报错问题
- Vue 报错TypeError: this.$set is not a function 的解决方法
- 解决vue安装less报错Failed to compile with 1 errors的问题
- Vue报错Syntax Error:TypeError: this.getOptions is not a function的解决方法
- Vue项目报错:Uncaught SyntaxError: Unexpected token '<'的解决方法
- 完美解决vue中报错 “TypeError: Cannot read properties of null (reading'forEach')“
- Vue报错:TypeError: Cannot create property ‘xxxx‘ on的解决
- Vue报错error:0308010C:digital envelope routines::unsupported的解决方法
- VUE Error: getaddrinfo ENOTFOUND localhost
相关文章
谈谈VUE种methods watch和compute的区别和联系
本篇文章主要介绍了谈谈VUE种methods watch和compute的区别和联系,具有一定的参考价值,有兴趣的可以了解一下2017-08-08
Vue 3 中的 toRef 和 toRefs 函数案例讲解
这篇文章主要介绍了Vue 3 中的 toRef 和 toRefs 函数,toRef 和 toRefs 函数是 Vue 3 中的两个非常有用的函数,它们可以帮助我们更好地管理组件中的响应式数据,并且可以提高组件的性能和用户体验,需要的朋友可以参考下2024-06-06


最新评论