简体   繁体   English

./src/index.js 找不到模块:无法解析“c:\users\.....”中的“react-dom/client”

[英]./src/index.js Module not found: Can't resolve 'react-dom/client' in "c:\users\....."

Above is the code of the index.js file, below is the error shown in this file上面是 index.js 文件的代码,下面是这个文件中显示的错误

I have tried solving this error in many ways, I have also updated the React and React DOM to version "react": "^18.0.0-rc.0", "react-dom": "^18.0.0-rc.0".我已尝试通过多种方式解决此错误,我还将 React 和 React DOM 更新为版本“react”:“^18.0.0-rc.0”,“react-dom”:“^18.0.0-rc. 0”。 I also tried deleting the node modules and re-installing node modules.我还尝试删除节点模块并重新安装节点模块。 Waiting for solutions.等待解决方案。 Also not able to understand these Chokidar errors.也无法理解这些 Chokidar 错误。

Try installing both react and react dom to latest stable v18 builds尝试将 react 和 react dom 安装到最新的稳定 v18 版本

npm i react@latest react-dom@latest

Additionally there's an error in your console about files being locked.此外,您的控制台中存在有关文件被锁定的错误。 Did you update the dependencies while the client was still running?您是否在客户端仍在运行时更新了依赖项?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 找不到模块:错误:无法解析“react-dom/client” - Module not found: Error: Can't resolve 'react-dom/client' 找不到模块:无法解析“react-dom” - Module not found: Can't resolve 'react-dom' ./src/components/index.js找不到模块:无法解析“ / src / components”中的“ ./{Component}” - ./src/components/index.js Module not found: Can't resolve './{Component}' in '/src/components' 找不到入口模块:错误:无法解析'./src/index.js' - Entry module not found: Error: Can't resolve './src/index.js' React 运行错误无法解析 react-dom/client - React Run Error Can't resolve react-dom/client 尝试创建可读的输出包但错误消息:- 未找到入口模块:错误:无法解析“./src/index.js” - Trying to create readable output bundle but error message:- Entry module not found: Error: Can't resolve './src/index.js' 找不到模块:无法解析'\\ node_modules \\ react-addons-perf'中的'react-dom / lib / ReactPerf' - Module not found: Can't resolve 'react-dom/lib/ReactPerf' in '\node_modules\react-addons-perf' ./src/Firebase.js 模块未找到:无法解析“C:\\Users\\HP\\Desktop\\React\\clone\\disney-plus-clone\\src”中的“firebase” - ./src/Firebase.js Module not found: Can't resolve 'firebase' in 'C:\Users\HP\Desktop\React\clones\disney-plus-clone\src' 反应:找不到模块:无法解析“/usr/src/app/src”中的“react-router-dom” - React: Module not found: Can't resolve 'react-router-dom' in '/usr/src/app/src' ReactJS:将 index.js 转换为 index.tsx - 未找到模块:错误:无法解析“./App” - ReactJS: Converting index.js to index.tsx - Module not found: Error: Can't resolve './App'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM