解决方案:
方案1:打开IDEA 终端,直接输入
Linux & Mac OS:
export NODE_OPTIONS=--openssl-legacy-provider
Windows:
set NODE_OPTIONS=--openssl-legacy-provider
方案2:打开IDEA 终端,直接输入(问题解决)
$env:NODE_OPTIONS="--openssl-legacy-provider"
方案3:卸载当前版本,安装合适的版本(node.js)
方案4:
解决方式(快速----仅限 windows):
在项目中 package.json 的 scripts 中新增 SET NODE_OPTIONS=--openssl-legacy-provider
原文链接:https://blog.csdn.net/scholar_man/article/details/134491200
添加前:
"scripts": {
"dev": "vue-cli-service serve",
"build:prod": "vue-cli-service build"
},
添加后:
"scripts": {
"dev": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",
"build:prod": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build"
},