复现环境:mac M1芯片电脑 + node@18.15.0 + esbuild@0.16.17

复现步骤:按照uniapp官网命令,初始化vue3+vite项目

npx degit dcloudio/uni-preset-vue#vite-ts my-vue3-project

 -》npm install -》点击Hbuildx编辑器顶部的 '运行' -》 ‘运行到小程序模拟器’ -》“微信开发者工具-【XXX】”-》控制台报错:

failed to load config from /Users/stephen/code/my-vue3-project/vite.config.js  
11:40:54.464 error when starting dev server:  
11:40:54.467 Error:   
11:40:54.468 You installed esbuild on another platform than the one you're currently using.....

解决:手动安装esbuild版本对应的@esbuild/darwin-x64库即可

        pnpm add @esbuild/darwin-x64@0.16.17 -D

参考链接:

Logo

前往低代码交流专区

更多推荐