安装VUE3,运行dev报错

来源:8-3 Vue3 项目的创建方式

慕粉3910982

2023-07-19

failed to load config from /Users/zhanghaoran/learn/vue3/vue-project/vite.config.js
error when starting dev server:
Error: Cannot find module 'node:url’
Require stack:

  • /Users/zhanghaoran/learn/vue3/vue-project/vite.config.js
  • /Users/zhanghaoran/learn/vue3/vue-project/node_modules/vite/dist/node/chunks/dep-abb4f102.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object. (/Users/zhanghaoran/learn/vue3/vue-project/vite.config.js:35:23)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object._require.extensions. [as .js] (file:///Users/zhanghaoran/learn/vue3/vue-project/node_modules/vite/dist/node/chunks/dep-abb4f102.js:66146:24)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! vue-project@0.0.0 dev: vite
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the vue-project@0.0.0 dev script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/zhanghaoran/.npm/_logs/2023-07-19T13_12_21_548Z-debug.log

写回答

1回答

coder_monkey

2023-07-19

这里有报错哦 Error: Cannot find module 'node:url

node 版本升级一下就行了 或者安装最新的 

0
0

Vue3+Uni+Node+MySQL 从零实现跨端小程序的全栈应用

小程序、 Vue3、Uni、NodeJs,全新300+技术点,实现跨端全栈应用

274 学习 · 155 问题

查看课程