我的專案昨天運行良好,但今天重新訪問專案後,我在嘗試運行該專案時遇到了此錯誤。
這是我的vite.config.js 檔案:
import { fileURLToPath, URL } from "node:url"; import { defineConfig } from "vite"; import vue from "@vitejs/plugin-vue"; // https://vitejs.dev/config/ export default defineConfig({ plugins: [vue()], resolve: { alias: { "@": fileURLToPath(new URL("./src", import.meta.url)), }, }, });
這是我收到的錯誤:
failed to load config from C:UsersDesktopLearnProjectvuejs-frontendvite.config.js error when starting dev server: Error: The service was stopped at C:UsersDesktopLearnProjectvuejs-frontendnode_modulesesbuildlibmain.js:1337:25 at C:UsersDesktopLearnProjectvuejs-frontendnode_modulesesbuildlibmain.js:666:9 at Socket.afterClose (C:UsersDesktopLearnProjectvuejs-frontendnode_modulesesbuildlibmain.js:644:7) at Socket.emit (node:events:539:35) at endReadableNT (node:internal/streams/readable:1345:12) at processTicksAndRejections (node:internal/process/task_queues:83:21)
請與我分享您知道的任何有用的提示。謝謝
請檢查您的節點版本,在我的例子中,我更新了我的節點版本 {node: 'v14.17.6'},如下所示,一切順利。
--- 紀錄 --- 包:'vite@3.0.2', 必需:{ 節點:'^14.18.0 || >=16.0.0' }, 目前:{節點:'v14.17.6',npm:'8.15.0'}
希望對你有幫助