Vite构建的前端项目在执行 "npm run dev" 命令时报错 "failed to load vite.config.ts"

报错信息:

Failed to load config from xx/.../xx/vite.config.ts error during build:
Error:

You installed esbuild for another platform than the one you're currently using.
This won't work because esbuild is written with native code and needs to install a
platform-specific binary executable.

Specifically the "@esbuild/darwin-x64" package is present but this platform needs
the "@esbuild/darwin-x64" package instead. ......

 

解决方案:

1. 删除项目本地的 node_modules,然后重新安装,问题解决(优先推荐);
2. 网上其他版本的处理方案:检查 ~/. vscode/extensions 文件夹,然后安装 @esbuild/darwin-x64;

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章