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

简介: 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)
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/

原因

模块不兼容

目录
相关文章
|
4月前
|
JavaScript
node环境之Error: Cannot find module ‘chalk’ 报错无法解决的问题—-网上说让你npm install chalk 基本是没有用的-优雅草央千澈解决方案
node环境之Error: Cannot find module ‘chalk’ 报错无法解决的问题—-网上说让你npm install chalk 基本是没有用的-优雅草央千澈解决方案
369 13
node环境之Error: Cannot find module ‘chalk’ 报错无法解决的问题—-网上说让你npm install chalk 基本是没有用的-优雅草央千澈解决方案
|
6月前
|
存储 开发框架 JavaScript
Node.js实现短链接(ShortLink):shortid、epxress让URL更简单
Node.js实现短链接(ShortLink):shortid、epxress让URL更简单
194 0
Node.js实现短链接(ShortLink):shortid、epxress让URL更简单
|
8月前
optional install error: Error: Unsupported URL Type: npm:vue-loader@^16.1.0
optional install error: Error: Unsupported URL Type: npm:vue-loader@^16.1.0
88 3
|
8月前
|
JavaScript
NodeJs——Parsing error: Cannot read file '.../tsconfig.json'.eslint
NodeJs——Parsing error: Cannot read file '.../tsconfig.json'.eslint
103 0
|
8月前
|
机器学习/深度学习 JavaScript
node.js实现遍历所有文件夹里面的js文件,提取所有的url
node.js实现遍历所有文件夹里面的js文件,提取所有的url
|
9月前
|
JavaScript
若依修改,This relative module was not found:* ./@/assets/logo/logo.png in ./node_modules/css-loader/dist
若依修改,This relative module was not found:* ./@/assets/logo/logo.png in ./node_modules/css-loader/dist
若依修改,This relative module was not found:* ./@/assets/logo/logo.png in ./node_modules/css-loader/dist
|
7月前
|
前端开发 JavaScript
前端JS截取url上的参数
文章介绍了两种前端JS获取URL参数的方法:手动截取封装和使用URLSearchParams。
105 0
|
8月前
|
开发框架 前端开发 .NET
Asp.net Webapi 的 Post 方法不能把参数加到 URL 中?试试这样写
Asp.net Webapi 的 Post 方法不能把参数加到 URL 中?试试这样写
108 0
|
8月前
|
Java
JAVA 获取 URL 指定参数的值
JAVA 获取 URL 指定参数的值
81 0

热门文章

最新文章