weiwosuoai / WeBlog

📗 Spring Boot + Vue 3.2 + Vite 4.3 前后端分离个人博客(可作为 Java 毕业设计项目)~ 感谢点个 Star 呀~
http://116.62.199.48/
MIT License
431 stars 82 forks source link

前端启动运行时报vite.config.js不存在模块node:url #2

Closed HuiKwen closed 1 year ago

HuiKwen commented 1 year ago

前端进行install后,直接通过 'npm run dev' 命令进行启动运行。但发现报错。(本人使用的node版本是:v14.17.0)

` failed to load config from E:\Study\WeBlog\weblog-vue3\vite.config.js error when starting dev server: Error: Cannot find module 'node:url' Require stack:

即时根据网上搜索的内容将import 中内容改成以下,则寻找不到的模块变成是path

import { fileURLToPath, URL } from 'url'

` Error: Cannot find module 'node:path' Require stack:

`

想请教一下楼主这个问题您有遇到过么?

weiwosuoai commented 1 year ago

我的 node 版本:18.15.0, 学习 vue 3 官方要求最低版本 16.0+, 建议升级一下再试试