npm啟動vue專案報錯error:0308010C:digital envelope routines::unsupported的解決辦法

仲夏今天也在写前端發表於2024-03-13

錯誤截圖

解決方法

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"
  },

相關文章