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;

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