Error: Cannot find module ‘node:url‘【已解决】

文章目录

异常信息

failed to load config from D:\javapub\chat\chatgpt-vue\vite.config.ts
error during build:
Error: Cannot find module 'node:url'
Require stack:
- D:\javapub\chat\chatgpt-vue\vite.config.ts
- D:\javapub\chat\chatgpt-vue\node_modules\vite\dist\node\chunks\dep-ca21228b.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
    at Function.Module._load (internal/modules/cjs/loader.js:746:27)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:92:18)
    at Object.<anonymous> (D:\javapub\chat\chatgpt-vue\vite.config.ts:36:23)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object._require.extensions.<computed> [as .js] (file:///D:/javapub/chat/chatgpt-vue/node_modules/vite/dist/node/chunks/dep-ca21228b.js:62356:24)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:14)
    at Module.require (internal/modules/cjs/loader.js:974:19)

解决

建议直接用终极解决办法,升级 node 版本

https://nodejs.cn/download/current/

原因

模块不兼容

猜你喜欢

转载自blog.csdn.net/qq_40374604/article/details/129507483