欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

centos打包项目时出现的问题及解决方法

程序员文章站 2022-05-13 20:53:39
...

使用

	npm run build:prod

报错

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build:prod: `vue-cli-service build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] 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