在package.json中添加下列代码即可
set NODE_OPTIONS=--openssl-legacy-provider &&
实例:
"scripts": {
"pre": "cnpm install || yarn --registry https://registry.npm.taobao.org || npm install --registry https://registry.npm.taobao.org ",
"serve": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",
"build:test": "vue-cli-service build --mode test",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},