0308010C:digital envelope routines::unsupported

发布时间 2023-03-22 21:16:31作者: Insus.NET

node.js为全新版本Node.js v18.15.0。许多网站说是因为node版本过高,需要降级。

可以参考如下步骤和代码来进行。


把:

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

 

改为:

修改package.json,在相关构建命令之前加入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"
},

 

保存并关闭。