跳转到内容

package.json配置问题

高版本node环境运行低版本node项目报错vue2+webpack

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

解决办法

dev中添加set NODE_OPTIONS=--openssl-legacy-provider

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

npm run build时报错

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out

解决办法

"build": "vite build",更换以下内容

"scripts": {
  // "build": "vite build",
  "build": "node --max_old_space_size=4096 node_modules/vite/bin/vite.js build",
},