在vue中,2个不同node版本的项目,同时运行

216 阅读1分钟

在低版本node的项目 package.json里添加上以下代码,就可以同时运行了

  "scripts": {
    "dev": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve", //非常重要
    "build:prod": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build",//非常重要
    "build:stage": "vue-cli-service build --mode staging",
    "preview": "node build/index.js --preview",
    "lint": "eslint --ext .js,.vue src"
  },