node 运行报错 Error: error:0308010C:digital envelope routines::unsupported

错误:

Error: error:0308010C:digital envelope routines::unsupported

解决:
修改 package.json 中的运行脚本,增加 set NODE_OPTIONS=--openssl-legacy-provider && 即可

原始 json

  "scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build",
    "lint": "vue-cli-service lint"
  }

修改后

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

你可能感兴趣的:(vue.js,javascript,前端)