【问题标题】:Dependency is not renamed依赖没有重命名
【发布时间】:2021-02-25 17:44:45
【问题描述】:

我最近用 Gatsby 创建了一个项目。当我尝试使用 @emotion/core 和 @emotion/styled 时,它显示了一个错误。

请参阅有关调试 HTML 构建的文档页面以获取帮助 https://gatsby.dev/debug-html @emotion/core 包已重命名为 @emotion/react。请像这样导入它import { jsx } from '@emotion/react'

2 |

3 | throw new Error("@emotion/core 包已重命名为@emotion/react。请像这样导入它import { jsx } from '@emotion/react'。"); | ^ 4 |

WebpackError:@emotion/core 包已重命名为 @emotion/react。请像这样导入它import { jsx } from '@emotion/react'

  • emotion-core.cjs.dev.js:3 node_modules/@emotion/core/dist/emotion-core.cjs.dev.js:3:1

  • 情感核心.cjs.js:6 node_modules/@emotion/core/dist/emotion-core.cjs.js:6:20

  • gatsby-ssr.js:9 node_modules/gatsby-plugin-manifest/gatsby-ssr.js:9:15enter code here

我已经将它重命名并导入,因为它在那里显示。我也尝试使用 Gatsby clean 并删除 node_modules 并重新安装,但仍然出现错误。感谢您的帮助。

【问题讨论】:

    标签: reactjs npm


    【解决方案1】:

    我遇到了同样的问题,并通过降级 @emotion/core 包解决了。

    npm install @emotion/core@10.1.1
    

    【讨论】:

      猜你喜欢
      • 2022-07-23
      • 2017-08-04
      • 2013-10-22
      • 2012-09-28
      • 1970-01-01
      • 1970-01-01
      • 2017-11-20
      • 2015-02-28
      • 1970-01-01
      相关资源
      最近更新 更多