Solve the error: failed to load config from /Users/stephen/code/my-vue3-project/vite.config.js

Reproduction environment : mac M1 chip computer + [email protected] + [email protected]

Reproduction steps : Follow the uniapp official website command to initialize the vue3+vite project

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

 -》npm install -》Click 'Run' at the top of the Hbuildx editor -》'Run to mini program simulator' -》"WeChat Developer Tools-[XXX]"-》Console error:

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.....

Solution : Manually install the @esbuild/darwin-x64 library corresponding to the esbuild version .

        pnpm add @esbuild/[email protected] -D

Reference links:

Guess you like

Origin blog.csdn.net/qq_38969618/article/details/130830013