uniapp新建的vuecli项目启动报错并且打包失败的问题(已解决)

2023-11-05 06:30

本文主要是介绍uniapp新建的vuecli项目启动报错并且打包失败的问题(已解决),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

 我的项目新建流程如下

 

运行之后就是如下报错 

解决办法:

安装如下依赖: 

 npm i postcss-loader autoprefixer@8.0.0

 npm run build 编译失败

 安装如下依赖:

npm install postcss@8.2.2

最终package.json文件如下

{"name": "lsyj-app-vuecli","version": "1.1.0","private": true,"scripts": {"serve": "npm run dev:h5","build": "npm run build:h5","build:app-plus": "cross-env NODE_ENV=production UNI_PLATFORM=app-plus vue-cli-service uni-build","build:custom": "cross-env NODE_ENV=production uniapp-cli custom","build:h5": "cross-env NODE_ENV=production UNI_PLATFORM=h5 vue-cli-service uni-build","build:mp-360": "cross-env NODE_ENV=production UNI_PLATFORM=mp-360 vue-cli-service uni-build","build:mp-alipay": "cross-env NODE_ENV=production UNI_PLATFORM=mp-alipay vue-cli-service uni-build","build:mp-baidu": "cross-env NODE_ENV=production UNI_PLATFORM=mp-baidu vue-cli-service uni-build","build:mp-jd": "cross-env NODE_ENV=production UNI_PLATFORM=mp-jd vue-cli-service uni-build","build:mp-kuaishou": "cross-env NODE_ENV=production UNI_PLATFORM=mp-kuaishou vue-cli-service uni-build","build:mp-lark": "cross-env NODE_ENV=production UNI_PLATFORM=mp-lark vue-cli-service uni-build","build:mp-qq": "cross-env NODE_ENV=production UNI_PLATFORM=mp-qq vue-cli-service uni-build","build:mp-toutiao": "cross-env NODE_ENV=production UNI_PLATFORM=mp-toutiao vue-cli-service uni-build","build:mp-weixin": "cross-env NODE_ENV=production UNI_PLATFORM=mp-weixin vue-cli-service uni-build","build:mp-xhs": "cross-env NODE_ENV=production UNI_PLATFORM=mp-xhs vue-cli-service uni-build","build:quickapp-native": "cross-env NODE_ENV=production UNI_PLATFORM=quickapp-native vue-cli-service uni-build","build:quickapp-webview": "cross-env NODE_ENV=production UNI_PLATFORM=quickapp-webview vue-cli-service uni-build","build:quickapp-webview-huawei": "cross-env NODE_ENV=production UNI_PLATFORM=quickapp-webview-huawei vue-cli-service uni-build","build:quickapp-webview-union": "cross-env NODE_ENV=production UNI_PLATFORM=quickapp-webview-union vue-cli-service uni-build","dev:app-plus": "cross-env NODE_ENV=development UNI_PLATFORM=app-plus vue-cli-service uni-build --watch","dev:custom": "cross-env NODE_ENV=development uniapp-cli custom","dev:h5": "cross-env NODE_ENV=development UNI_PLATFORM=h5 vue-cli-service uni-serve","dev:mp-360": "cross-env NODE_ENV=development UNI_PLATFORM=mp-360 vue-cli-service uni-build --watch","dev:mp-alipay": "cross-env NODE_ENV=development UNI_PLATFORM=mp-alipay vue-cli-service uni-build --watch","dev:mp-baidu": "cross-env NODE_ENV=development UNI_PLATFORM=mp-baidu vue-cli-service uni-build --watch","dev:mp-jd": "cross-env NODE_ENV=development UNI_PLATFORM=mp-jd vue-cli-service uni-build --watch","dev:mp-kuaishou": "cross-env NODE_ENV=development UNI_PLATFORM=mp-kuaishou vue-cli-service uni-build --watch","dev:mp-lark": "cross-env NODE_ENV=development UNI_PLATFORM=mp-lark vue-cli-service uni-build --watch","dev:mp-qq": "cross-env NODE_ENV=development UNI_PLATFORM=mp-qq vue-cli-service uni-build --watch","dev:mp-toutiao": "cross-env NODE_ENV=development UNI_PLATFORM=mp-toutiao vue-cli-service uni-build --watch","dev:mp-weixin": "cross-env NODE_ENV=development UNI_PLATFORM=mp-weixin vue-cli-service uni-build --watch","dev:mp-xhs": "cross-env NODE_ENV=development UNI_PLATFORM=mp-xhs vue-cli-service uni-build --watch","dev:quickapp-native": "cross-env NODE_ENV=development UNI_PLATFORM=quickapp-native vue-cli-service uni-build --watch","dev:quickapp-webview": "cross-env NODE_ENV=development UNI_PLATFORM=quickapp-webview vue-cli-service uni-build --watch","dev:quickapp-webview-huawei": "cross-env NODE_ENV=development UNI_PLATFORM=quickapp-webview-huawei vue-cli-service uni-build --watch","dev:quickapp-webview-union": "cross-env NODE_ENV=development UNI_PLATFORM=quickapp-webview-union vue-cli-service uni-build --watch","info": "node node_modules/@dcloudio/vue-cli-plugin-uni/commands/info.js","serve:quickapp-native": "node node_modules/@dcloudio/uni-quickapp-native/bin/serve.js","test:android": "cross-env UNI_PLATFORM=app-plus UNI_OS_NAME=android jest -i","test:h5": "cross-env UNI_PLATFORM=h5 jest -i","test:ios": "cross-env UNI_PLATFORM=app-plus UNI_OS_NAME=ios jest -i","test:mp-baidu": "cross-env UNI_PLATFORM=mp-baidu jest -i","test:mp-weixin": "cross-env UNI_PLATFORM=mp-weixin jest -i"},"dependencies": {"@dcloudio/uni-app": "^2.0.2-3090520231028001","@dcloudio/uni-app-plus": "^2.0.2-3090520231028001","@dcloudio/uni-h5": "^2.0.2-3090520231028001","@dcloudio/uni-i18n": "^2.0.2-3090520231028001","@dcloudio/uni-mp-360": "^2.0.2-3090520231028001","@dcloudio/uni-mp-alipay": "^2.0.2-3090520231028001","@dcloudio/uni-mp-baidu": "^2.0.2-3090520231028001","@dcloudio/uni-mp-jd": "^2.0.2-3090520231028001","@dcloudio/uni-mp-kuaishou": "^2.0.2-3090520231028001","@dcloudio/uni-mp-lark": "^2.0.2-3090520231028001","@dcloudio/uni-mp-qq": "^2.0.2-3090520231028001","@dcloudio/uni-mp-toutiao": "^2.0.2-3090520231028001","@dcloudio/uni-mp-vue": "^2.0.2-3090520231028001","@dcloudio/uni-mp-weixin": "^2.0.2-3090520231028001","@dcloudio/uni-mp-xhs": "^2.0.2-3090520231028001","@dcloudio/uni-quickapp-native": "^2.0.2-3090520231028001","@dcloudio/uni-quickapp-webview": "^2.0.2-3090520231028001","@dcloudio/uni-stacktracey": "^2.0.2-3090520231028001","@dcloudio/uni-stat": "^2.0.2-3090520231028001","@vue/shared": "^3.0.0","autoprefixer": "^8.0.0","core-js": "^3.8.3","flyio": "^0.6.2","postcss": "^8.2.2","postcss-loader": "^7.3.3","vue": ">= 2.6.14 < 2.7","vuex": "^3.2.0"},"devDependencies": {"@dcloudio/types": "^3.3.2","@dcloudio/uni-automator": "^2.0.2-3090520231028001","@dcloudio/uni-cli-i18n": "^2.0.2-3090520231028001","@dcloudio/uni-cli-shared": "^2.0.2-3090520231028001","@dcloudio/uni-helper-json": "*","@dcloudio/uni-migration": "^2.0.2-3090520231028001","@dcloudio/uni-template-compiler": "^2.0.2-3090520231028001","@dcloudio/vue-cli-plugin-hbuilderx": "^2.0.2-3090520231028001","@dcloudio/vue-cli-plugin-uni": "^2.0.2-3090520231028001","@dcloudio/vue-cli-plugin-uni-optimize": "^2.0.2-3090520231028001","@dcloudio/webpack-uni-mp-loader": "^2.0.2-3090520231028001","@dcloudio/webpack-uni-pages-loader": "^2.0.2-3090520231028001","@vue/cli-plugin-babel": "~5.0.0","@vue/cli-service": "~5.0.0","babel-plugin-import": "^1.11.0","cross-env": "^7.0.2","jest": "^25.4.0","node-sass": "^4.14.1","postcss-comment": "^2.0.0","sass-loader": "^7.3.1","vue-template-compiler": ">= 2.6.14 < 2.7"},"browserslist": ["Android >= 4.4","ios >= 9"],"uni-app": {"scripts": {}}
}

这篇关于uniapp新建的vuecli项目启动报错并且打包失败的问题(已解决)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/348046

相关文章

微信公众号脚本-获取热搜自动新建草稿并发布文章

《微信公众号脚本-获取热搜自动新建草稿并发布文章》本来想写一个自动化发布微信公众号的小绿书的脚本,但是微信公众号官网没有小绿书的接口,那就写一个获取热搜微信普通文章的脚本吧,:本文主要介绍微信公众... 目录介绍思路前期准备环境要求获取接口token获取热搜获取热搜数据下载热搜图片给图片加上标题文字上传图片

springboot循环依赖问题案例代码及解决办法

《springboot循环依赖问题案例代码及解决办法》在SpringBoot中,如果两个或多个Bean之间存在循环依赖(即BeanA依赖BeanB,而BeanB又依赖BeanA),会导致Spring的... 目录1. 什么是循环依赖?2. 循环依赖的场景案例3. 解决循环依赖的常见方法方法 1:使用 @La

Spring事务中@Transactional注解不生效的原因分析与解决

《Spring事务中@Transactional注解不生效的原因分析与解决》在Spring框架中,@Transactional注解是管理数据库事务的核心方式,本文将深入分析事务自调用的底层原理,解释为... 目录1. 引言2. 事务自调用问题重现2.1 示例代码2.2 问题现象3. 为什么事务自调用会失效3

一文教你如何将maven项目转成web项目

《一文教你如何将maven项目转成web项目》在软件开发过程中,有时我们需要将一个普通的Maven项目转换为Web项目,以便能够部署到Web容器中运行,本文将详细介绍如何通过简单的步骤完成这一转换过程... 目录准备工作步骤一:修改​​pom.XML​​1.1 添加​​packaging​​标签1.2 添加

Flutter打包APK的几种方式小结

《Flutter打包APK的几种方式小结》Flutter打包不同于RN,Flutter可以在AndroidStudio里编写Flutter代码并最终打包为APK,本篇主要阐述涉及到的几种打包方式,通... 目录前言1. android原生打包APK方式2. Flutter通过原生工程打包方式3. Futte

mysql出现ERROR 2003 (HY000): Can‘t connect to MySQL server on ‘localhost‘ (10061)的解决方法

《mysql出现ERROR2003(HY000):Can‘tconnecttoMySQLserveron‘localhost‘(10061)的解决方法》本文主要介绍了mysql出现... 目录前言:第一步:第二步:第三步:总结:前言:当你想通过命令窗口想打开mysql时候发现提http://www.cpp

tomcat多实例部署的项目实践

《tomcat多实例部署的项目实践》Tomcat多实例是指在一台设备上运行多个Tomcat服务,这些Tomcat相互独立,本文主要介绍了tomcat多实例部署的项目实践,具有一定的参考价值,感兴趣的可... 目录1.创建项目目录,测试文China编程件2js.创建实例的安装目录3.准备实例的配置文件4.编辑实例的

Docker镜像pull失败两种解决办法小结

《Docker镜像pull失败两种解决办法小结》有时候我们在拉取Docker镜像的过程中会遇到一些问题,:本文主要介绍Docker镜像pull失败两种解决办法的相关资料,文中通过代码介绍的非常详细... 目录docker 镜像 pull 失败解决办法1DrQwWCocker 镜像 pull 失败解决方法2总

SpringBoot启动报错的11个高频问题排查与解决终极指南

《SpringBoot启动报错的11个高频问题排查与解决终极指南》这篇文章主要为大家详细介绍了SpringBoot启动报错的11个高频问题的排查与解决,文中的示例代码讲解详细,感兴趣的小伙伴可以了解一... 目录1. 依赖冲突:NoSuchMethodError 的终极解法2. Bean注入失败:No qu

PyCharm如何设置新建文件默认为LF换行符

《PyCharm如何设置新建文件默认为LF换行符》:本文主要介绍PyCharm如何设置新建文件默认为LF换行符问题,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录PyCharm设置新建文件默认为LF换行符设置换行符修改换行符总结PyCharm设置新建文件默认为LF