使用
npm run build:prod
报错
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ruoyi@2.3.0 build:prod: `vue-cli-service build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ruoyi@2.3.0 build:prod script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-06-12T02_33_03_854Z-debug.log
解决办法
1.使用阿里定制的 cnpm 命令行工具代替默认的 npm,输入下面代码进行安装:
npm install -g cnpm --registry=https://registry.npm.taobao.org
2.根据错误提示安装
cnpm i -D node-sass
cnpm rebuild --unsafe-perm node-sass
cnpm run build:prod