我的项目昨天运行良好,但今天重新访问项目后,我在尝试运行该项目时遇到了此错误。
这是我的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)
请与我分享您知道的任何有用的提示。谢谢
P粉5956057592023-10-23 00:49:48
请检查您的节点版本,在我的例子中,我更新了我的节点版本 {node: 'v14.17.6'},如下所示,一切顺利。
--- 日志 --- 包:'vite@3.0.2', 必需:{ 节点:'^14.18.0 || >=16.0.0' }, 当前:{节点:'v14.17.6',npm:'8.15.0'}
希望对你有帮助