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

发布于 2025-01-20 13:53:50 字数 256 浏览 2 评论 0原文

上面是index.js文件的代码,下面是该文件中显示的错误

I已经尝试以多种方式解决此错误,我还将 React 和 React DOM 更新到版本 “反应”:“^18.0.0-rc.0”, “react-dom”:“^18.0.0-rc.0”。我还尝试删除节点模块并重新安装节点模块。等待解决方案。也无法理解这些 Chokidar 错误。

Above is the code of the index.js file, below is the error shown in this file

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". I also tried deleting the node modules and re-installing node modules. Waiting for solutions. Also not able to understand these Chokidar errors.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

追我者格杀勿论 2025-01-27 13:53:50

尝试将 React 和 React dom 安装到最新稳定的 v18 版本

npm i react@latest react-dom@latest

此外,您的控制台中存在有关文件被锁定的错误。您是否在客户端仍在运行时更新了依赖项?

Try installing both react and react dom to latest stable v18 builds

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?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文