请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

安装VUE3,运行dev报错

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

正在回答 回答被采纳积分+3

插入代码

1回答

coder_monkey 2023-07-19 21:38:46

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

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

0 回复 有任何疑惑可以回复我~
问题已解决,确定采纳
还有疑问,暂不采纳
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号