oyjt / uniapp-vue3-template

使用uniapp+vite+vue3+uview-plus3.0 搭建的搭建的适合团队协作的快速开发模版
http://icnpath.com/uniapp-vue3-template/
MIT License
235 stars 53 forks source link

通过uniapp菜单栏运行微信小程序报错 #18

Closed EMRZZZ closed 3 months ago

EMRZZZ commented 3 months ago

提示CACError: Unknown option --watch`异常

![Uploading 1722349935729.png…]()

EMRZZZ commented 3 months ago

之前的点错关闭了。。 C:\project\ToDoEa\uniapp-vue3-template-main\node_modules.pnpm\cac@6.7.9\node_modules\cac\dist\index.js:404 throw new CACError(Unknown option \${name.length > 1 ? --${name} : -${name}}); ^ CACError: Unknown option --watch at Command.checkUnknownOptions (C:\project\ToDoEa\uniapp-vue3-template-main\node_modules.pnpm\cac@6.7.9\node_modules\cac\dist\index.js:404:17) at CAC.runMatchedCommand (C:\project\ToDoEa\uniapp-vue3-template-main\node_modules.pnpm\cac@6.7.9\node_modules\cac\dist\index.js:602:13) at CAC.parse (C:\project\ToDoEa\uniapp-vue3-template-main\node_modules.pnpm\cac@6.7.9\node_modules\cac\dist\index.js:541:12) at Object. (C:\project\ToDoEa\uniapp-vue3-template-main\node_modules.pnpm@dcloudio+vite-plugin-uni@3.0.0-4020420240722002_postcss@8.4.32_rollup@4.17.2vite@[5.2.8@typ772wsqyw23ev6csfaz5wocvovq](mailto:5.2.8@typ_772wsqyw23ev6csfaz5wocvovq)\node_modules@dcloudio\vite-plugin-uni\dist\cli\index.js:57:5) at Module._compile (node:internal/modules/cjs/loader:1358:14) at Module._extensions..js (node:internal/modules/cjs/loader:1416:10) at Module.load (node:internal/modules/cjs/loader:1208:32) at Module._load (node:internal/modules/cjs/loader:1024:12) at Module.require (node:internal/modules/cjs/loader:1233:19) at require (node:internal/modules/helpers:179:18) Node.js v20.16.0

oyjt commented 3 months ago

请问是什么环境运行的?我在windowmac上试了,都没复现该问题。 HBuilder X更新到最新版,拉取本仓库最新的代码再试试看。

EMRZZZ commented 3 months ago

通过将HBuilder X更新到最新版,问题得到了解决,之前只能通过命令行pnpm dev:mp-weixin,再手动导入,不清楚是什么问题导致的

EMRZZZ commented 3 months ago

Windows,HBuilder X版本3.12

oyjt commented 3 months ago

通过将HBuilder X更新到最新版,问题得到了解决,之前只能通过命令行pnpm dev:mp-weixin,再手动导入,不清楚是什么问题导致的

猜测是之前HBuilder X内置的vite版本比较旧导致的,之前的vite有版本确实存在相关问题。