npm启动vue项目报错error:0308010C:digital envelope routines::unsupported的解决办法

错误截图

解决方法

package.json文件中修改dev项为set NODE_OPTIONS=--openssl-legacy-provider & vue-cli-service serve:

  "scripts": {
    "dev": "set NODE_OPTIONS=--openssl-legacy-provider & vue-cli-service serve",
    "build:prod": "vue-cli-service build",
    "build:stage": "vue-cli-service build --mode staging",
    "preview": "node build/index.js --preview",
    "lint": "eslint --ext .js,.vue src"
  },
posted @ 2024-03-13 11:52  仲夏今天也在写前端  阅读(44)  评论(0编辑  收藏  举报