React.Js 样式组件出现此错误

发布于 2025-01-10 13:34:19 字数 205 浏览 0 评论 0原文

./src/components/Login.js 4:0-39 中出现错误

找不到模块:错误:找不到文件: 'styled-components.browser.esm.js' 与相应的不匹配 磁盘上的名称: '.\node_modules\styled-Components\dist\styled-components'。

ERROR in ./src/components/Login.js 4:0-39

Module not found: Error: Cannot find file:
'styled-components.browser.esm.js' does not match the corresponding
name on disk:
'.\node_modules\styled-Components\dist\styled-components'.

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

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

发布评论

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

评论(1

慈悲佛祖 2025-01-17 13:34:19

这看起来像是安装问题。在命令行中运行/输入

npm install --save styled-components

,然后通过运行 npm start 重新启动您的应用程序。

如果您使用yarn,请将 npm 替换为yarn。

如果问题解决了,请告诉我们!

This looks like an installation problem. Run/type in command line

npm install --save styled-components

and then restart your app, by running npm start

If you use yarn, replace npm with yarn.

Let us know if the issue resolves!

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