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

相关文章

Redis连接失败:客户端IP不在白名单中的问题分析与解决方案

《Redis连接失败:客户端IP不在白名单中的问题分析与解决方案》在现代分布式系统中,Redis作为一种高性能的内存数据库,被广泛应用于缓存、消息队列、会话存储等场景,然而,在实际使用过程中,我们可能... 目录一、问题背景二、错误分析1. 错误信息解读2. 根本原因三、解决方案1. 将客户端IP添加到Re

详谈redis跟数据库的数据同步问题

《详谈redis跟数据库的数据同步问题》文章讨论了在Redis和数据库数据一致性问题上的解决方案,主要比较了先更新Redis缓存再更新数据库和先更新数据库再更新Redis缓存两种方案,文章指出,删除R... 目录一、Redis 数据库数据一致性的解决方案1.1、更新Redis缓存、删除Redis缓存的区别二

oracle数据库索引失效的问题及解决

《oracle数据库索引失效的问题及解决》本文总结了在Oracle数据库中索引失效的一些常见场景,包括使用isnull、isnotnull、!=、、、函数处理、like前置%查询以及范围索引和等值索引... 目录oracle数据库索引失效问题场景环境索引失效情况及验证结论一结论二结论三结论四结论五总结ora

element-ui下拉输入框+resetFields无法回显的问题解决

《element-ui下拉输入框+resetFields无法回显的问题解决》本文主要介绍了在使用ElementUI的下拉输入框时,点击重置按钮后输入框无法回显数据的问题,具有一定的参考价值,感兴趣的... 目录描述原因问题重现解决方案方法一方法二总结描述第一次进入页面,不做任何操作,点击重置按钮,再进行下

解决mybatis-plus-boot-starter与mybatis-spring-boot-starter的错误问题

《解决mybatis-plus-boot-starter与mybatis-spring-boot-starter的错误问题》本文主要讲述了在使用MyBatis和MyBatis-Plus时遇到的绑定异常... 目录myBATis-plus-boot-starpythonter与mybatis-spring-b

Python pyinstaller实现图形化打包工具

《Pythonpyinstaller实现图形化打包工具》:本文主要介绍一个使用PythonPYQT5制作的关于pyinstaller打包工具,代替传统的cmd黑窗口模式打包页面,实现更快捷方便的... 目录1.简介2.运行效果3.相关源码1.简介一个使用python PYQT5制作的关于pyinstall

javafx 如何将项目打包为 Windows 的可执行文件exe

《javafx如何将项目打包为Windows的可执行文件exe》文章介绍了三种将JavaFX项目打包为.exe文件的方法:方法1使用jpackage(适用于JDK14及以上版本),方法2使用La... 目录方法 1:使用 jpackage(适用于 JDK 14 及更高版本)方法 2:使用 Launch4j(

Docker集成CI/CD的项目实践

《Docker集成CI/CD的项目实践》本文主要介绍了Docker集成CI/CD的项目实践,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学... 目录一、引言1.1 什么是 CI/CD?1.2 docker 在 CI/CD 中的作用二、Docke

SpringBoot项目引入token设置方式

《SpringBoot项目引入token设置方式》本文详细介绍了JWT(JSONWebToken)的基本概念、结构、应用场景以及工作原理,通过动手实践,展示了如何在SpringBoot项目中实现JWT... 目录一. 先了解熟悉JWT(jsON Web Token)1. JSON Web Token是什么鬼

手把手教你idea中创建一个javaweb(webapp)项目详细图文教程

《手把手教你idea中创建一个javaweb(webapp)项目详细图文教程》:本文主要介绍如何使用IntelliJIDEA创建一个Maven项目,并配置Tomcat服务器进行运行,过程包括创建... 1.启动idea2.创建项目模板点击项目-新建项目-选择maven,显示如下页面输入项目名称,选择